2015-02-22 12:07:08 -08:00
|
|
|
#ifndef ELM_CODE_TEXT_H_
|
|
|
|
# define ELM_CODE_TEXT_H_
|
|
|
|
|
2015-03-22 15:36:04 -07:00
|
|
|
#define ELM_CODE_TEXT_NOT_FOUND -1
|
|
|
|
|
2015-02-22 12:07:08 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief These routines are used for interacting with the textual content of files/lines in Elm Code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2015-03-14 09:42:56 -07:00
|
|
|
* @brief Line text handling functions.
|
|
|
|
* @defgroup Text access and manipulation within lines
|
2015-02-22 12:07:08 -08:00
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* Functions for handling content of lines within elm code.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-03-08 03:14:02 -07:00
|
|
|
EAPI const char *elm_code_line_text_get(Elm_Code_Line *line, unsigned int *length);
|
2015-02-22 12:07:08 -08:00
|
|
|
|
2015-03-08 03:33:07 -07:00
|
|
|
EAPI void elm_code_line_text_set(Elm_Code_Line *line, const char *chars, unsigned int length);
|
|
|
|
|
2015-03-22 15:36:04 -07:00
|
|
|
EAPI int elm_code_line_text_strpos(Elm_Code_Line *line, const char *search, int offset);
|
|
|
|
|
|
|
|
EAPI Eina_Bool elm_code_line_text_contains(Elm_Code_Line *line, const char *search);
|
|
|
|
|
2015-03-25 14:55:00 -07:00
|
|
|
EAPI char *elm_code_line_text_substr(Elm_Code_Line *line, unsigned int position, int length);
|
|
|
|
|
2015-03-07 11:48:02 -08:00
|
|
|
EAPI void elm_code_line_text_insert(Elm_Code_Line *line, unsigned int position, const char *string, int length);
|
2015-02-22 12:07:08 -08:00
|
|
|
|
2015-03-08 00:44:26 -08:00
|
|
|
EAPI void elm_code_line_text_remove(Elm_Code_Line *line, unsigned int position, int length);
|
|
|
|
|
2015-10-10 14:09:02 -07:00
|
|
|
EAPI void elm_code_line_text_leading_whitespace_strip(Elm_Code_Line *line);
|
|
|
|
|
2015-08-29 04:05:56 -07:00
|
|
|
EAPI void elm_code_line_text_trailing_whitespace_strip(Elm_Code_Line *line);
|
|
|
|
|
2015-03-14 09:42:56 -07:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*
|
|
|
|
* @brief Generic text handling functions.
|
|
|
|
* @defgroup Text helper functions
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* Functions for managing unicode text.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-04-19 07:00:10 -07:00
|
|
|
EAPI int elm_code_text_strnpos(const char *text, unsigned int length, const char *search, int offset);
|
|
|
|
|
2015-05-05 13:41:29 -07:00
|
|
|
EAPI int elm_code_text_newlinenpos(const char *text, unsigned int length, short *nllen);
|
2015-04-19 07:00:10 -07:00
|
|
|
|
2015-08-27 16:15:55 -07:00
|
|
|
EAPI unsigned int elm_code_text_is_whitespace(const char *text, unsigned int length);
|
|
|
|
|
2015-02-22 12:07:08 -08:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* ELM_CODE_TEXT_H_ */
|