These functions provide string buffers management. More...
Macros | |
#define | eina_strbuf_prepend(buf, str) eina_strbuf_insert(buf, str, 0) |
Prepends the given string to the given buffer. More... | |
#define | eina_strbuf_prepend_escaped(buf, str) eina_strbuf_insert_escaped(buf, str, 0) |
Prepends the given escaped string to the given buffer. More... | |
#define | eina_strbuf_prepend_n(buf, str, maxlen) eina_strbuf_insert_n(buf, str, maxlen, 0) |
Prepends the given escaped string to the given buffer. More... | |
#define | eina_strbuf_prepend_length(buf, str, length) eina_strbuf_insert_length(buf, str, length, 0) |
Prepends the given escaped string to the given buffer. More... | |
#define | eina_strbuf_prepend_char(buf, c) eina_strbuf_insert_char(buf, c, 0) |
Prepends the given character to the given buffer. More... | |
#define | eina_strbuf_prepend_printf(buf, fmt, ...) eina_strbuf_insert_printf(buf, fmt, 0, ## __VA_ARGS__) |
Prepends the given string to the given buffer. More... | |
#define | eina_strbuf_prepend_vprintf(buf, fmt, args) eina_strbuf_insert_vprintf(buf, fmt, 0, args) |
Prepends the given string to the given buffer. More... | |
#define | eina_strbuf_replace_first(buf, str, with) eina_strbuf_replace(buf, str, with, 1) |
Prepends the given character to the given buffer. More... | |
Typedefs | |
typedef struct _Eina_Strbuf | Eina_Strbuf |
Type for a string buffer. | |
Functions | |
Eina_Strbuf * | eina_strbuf_new (void) |
Creates a new string buffer. More... | |
Eina_Strbuf * | eina_strbuf_manage_new (char *str) |
Creates a new string buffer using the passed string. More... | |
Eina_Strbuf * | eina_strbuf_manage_new_length (char *str, size_t length) |
Creates a new string buffer using the passed string. More... | |
Eina_Strbuf * | eina_strbuf_manage_read_only_new_length (const char *str, size_t length) |
Creates a new string buffer using the passed string. More... | |
void | eina_strbuf_free (Eina_Strbuf *buf) |
Frees a string buffer. More... | |
void | eina_strbuf_reset (Eina_Strbuf *buf) |
Resets a string buffer. More... | |
Eina_Bool | eina_strbuf_append (Eina_Strbuf *buf, const char *str) |
Appends a string to a buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_append_escaped (Eina_Strbuf *buf, const char *str) |
Appends an escaped string to a buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_append_n (Eina_Strbuf *buf, const char *str, size_t maxlen) |
Appends a string to a buffer, reallocating as necessary, limited by the given length. More... | |
Eina_Bool | eina_strbuf_append_length (Eina_Strbuf *buf, const char *str, size_t length) |
Appends a string of exact length to a buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_append_slice (Eina_Strbuf *buf, const Eina_Slice slice) |
Append a slice to a buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_append_buffer (Eina_Strbuf *buf, const Eina_Strbuf *data) |
Appends an Eina_Strbuf to a buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_append_char (Eina_Strbuf *buf, char c) |
Appends a character to a string buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_append_printf (Eina_Strbuf *buf, const char *fmt,...) EINA_PRINTF(2 |
Appends a string to a buffer, reallocating as necessary. More... | |
Eina_Bool Eina_Bool | eina_strbuf_append_vprintf (Eina_Strbuf *buf, const char *fmt, va_list args) |
Appends a string to a buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_insert (Eina_Strbuf *buf, const char *str, size_t pos) |
Inserts a string to a buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_insert_escaped (Eina_Strbuf *buf, const char *str, size_t pos) |
Inserts an escaped string to a buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_insert_n (Eina_Strbuf *buf, const char *str, size_t maxlen, size_t pos) |
Inserts a string to a buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_insert_length (Eina_Strbuf *buf, const char *str, size_t length, size_t pos) |
Inserts a string of exact length to a buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_insert_slice (Eina_Strbuf *buf, const Eina_Slice slice, size_t pos) |
Insert a slice to a buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_insert_char (Eina_Strbuf *buf, char c, size_t pos) |
Inserts a character to a string buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_insert_printf (Eina_Strbuf *buf, const char *fmt, size_t pos,...) EINA_PRINTF(2 |
Inserts a string to a buffer, reallocating as necessary. More... | |
Eina_Bool Eina_Bool | eina_strbuf_insert_vprintf (Eina_Strbuf *buf, const char *fmt, size_t pos, va_list args) |
Inserts a string to a buffer, reallocating as necessary. More... | |
Eina_Bool | eina_strbuf_remove (Eina_Strbuf *buf, size_t start, size_t end) |
Removes a slice of the given string buffer. More... | |
const char * | eina_strbuf_string_get (const Eina_Strbuf *buf) |
Retrieves a pointer to the contents of a string buffer. More... | |
char * | eina_strbuf_string_steal (Eina_Strbuf *buf) |
Steals the contents of a string buffer. More... | |
void | eina_strbuf_string_free (Eina_Strbuf *buf) |
Frees the contents of a string buffer but not the buffer. More... | |
size_t | eina_strbuf_length_get (const Eina_Strbuf *buf) |
Retrieves the length of the string buffer content. More... | |
Eina_Bool | eina_strbuf_replace (Eina_Strbuf *buf, const char *str, const char *with, unsigned int n) |
Replaces the n-th string with an other string. More... | |
int | eina_strbuf_replace_all (Eina_Strbuf *buf, const char *str, const char *with) |
Replaces all strings with an other string. More... | |
void | eina_strbuf_trim (Eina_Strbuf *buf) |
Trims the string buffer. More... | |
void | eina_strbuf_ltrim (Eina_Strbuf *buf) |
Left trims the string buffer. More... | |
void | eina_strbuf_rtrim (Eina_Strbuf *buf) |
Right trims the string buffer. More... | |
void | eina_strbuf_tolower (Eina_Strbuf *buf) |
Converts the string to lower case. More... | |
Eina_Strbuf * | eina_strbuf_substr_get (Eina_Strbuf *buf, size_t pos, size_t len) |
Obtains substring from the src. More... | |
Eina_Slice | eina_strbuf_slice_get (const Eina_Strbuf *buf) |
Gets a read-only slice representing the current strbuf contents. More... | |
Eina_Rw_Slice | eina_strbuf_rw_slice_get (const Eina_Strbuf *buf) |
Gets a read-write slice representing the current strbuf contents. More... | |
char * | eina_strbuf_release (Eina_Strbuf *buf) |
Gets the string of the buffer and free the buffer. More... | |
These functions provide string buffers management.
The String Buffer data type is designed to be a mutable string, allowing to append, prepend or insert a string to a buffer.
For more information see this example.
#define eina_strbuf_prepend | ( | buf, | |
str | |||
) | eina_strbuf_insert(buf, str, 0) |
Prepends the given string to the given buffer.
buf | The string buffer to prepend to. |
str | The string to prepend. |
This macro is calling eina_strbuf_insert() at position 0. If buf
can't prepend it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
#define eina_strbuf_prepend_escaped | ( | buf, | |
str | |||
) | eina_strbuf_insert_escaped(buf, str, 0) |
Prepends the given escaped string to the given buffer.
buf | The string buffer to prepend to. |
str | The string to prepend. |
This macro is calling eina_strbuf_insert_escaped() at position 0. If buf
can't prepend it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
#define eina_strbuf_prepend_n | ( | buf, | |
str, | |||
maxlen | |||
) | eina_strbuf_insert_n(buf, str, maxlen, 0) |
Prepends the given escaped string to the given buffer.
buf | The string buffer to prepend to. |
str | The string to prepend. |
maxlen | The maximum number of chars to prepend. |
This macro is calling eina_strbuf_insert_n() at position 0. If buf
can't prepend it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
#define eina_strbuf_prepend_length | ( | buf, | |
str, | |||
length | |||
) | eina_strbuf_insert_length(buf, str, length, 0) |
Prepends the given escaped string to the given buffer.
buf | The string buffer to prepend to. |
str | The string to prepend. |
length | The exact length to use. |
This macro is calling eina_strbuf_insert_length() at position 0. If buf
can't prepend it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
#define eina_strbuf_prepend_char | ( | buf, | |
c | |||
) | eina_strbuf_insert_char(buf, c, 0) |
Prepends the given character to the given buffer.
buf | The string buffer to prepend to. |
c | The character to prepend. |
This macro is calling eina_strbuf_insert_char() at position 0. If buf
can't prepend it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
#define eina_strbuf_prepend_printf | ( | buf, | |
fmt, | |||
... | |||
) | eina_strbuf_insert_printf(buf, fmt, 0, ## __VA_ARGS__) |
Prepends the given string to the given buffer.
buf | The string buffer to prepend to. |
fmt | The string to prepend. |
This macro is calling eina_strbuf_insert_printf() at position 0. If buf
can't prepend it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
#define eina_strbuf_prepend_vprintf | ( | buf, | |
fmt, | |||
args | |||
) | eina_strbuf_insert_vprintf(buf, fmt, 0, args) |
Prepends the given string to the given buffer.
buf | The string buffer to prepend to. |
fmt | The string to prepend. |
args | The variable arguments. |
This macro is calling eina_strbuf_insert_vprintf() at position 0.If buf
can't prepend it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
#define eina_strbuf_replace_first | ( | buf, | |
str, | |||
with | |||
) | eina_strbuf_replace(buf, str, with, 1) |
Prepends the given character to the given buffer.
buf | The string buffer to work with. |
str | The string to replace. |
with | The replaceing string. |
This macro is calling eina_strbuf_replace() with the n-th occurrence equal to 1
. If buf
can't replace it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Eina_Strbuf* eina_strbuf_new | ( | void | ) |
Creates a new string buffer.
This function creates a new string buffer. On error, NULL
is returned. To free the resources, use eina_strbuf_free().
Referenced by ecore_file_app_exe_get(), edje_available_modules_get(), edje_edit_color_classes_source_generate(), edje_edit_data_source_generate(), edje_edit_script_error_list_get(), edje_evas_global_perspective_get(), edje_init(), edje_object_part_text_escaped_set(), eina_simple_xml_node_dump(), elm_gengrid_item_class_unref(), elm_genlist_item_class_unref(), elm_theme_get(), evas_object_textblock_text_markup_get(), evas_textblock_cursor_content_get(), evas_textblock_style_set(), evas_textblock_text_markup_to_utf8(), and evas_textblock_text_utf8_to_markup().
Eina_Strbuf* eina_strbuf_manage_new | ( | char * | str | ) |
Creates a new string buffer using the passed string.
The passed string is used directly as the buffer, it's somehow the opposite function of eina_strbuf_string_steal . The passed string must be malloced.
str | The string to manage |
This function creates a new string buffer. On error, NULL
is returned. To free the resources, use eina_strbuf_free().
Referenced by eina_strbuf_substr_get().
Eina_Strbuf* eina_strbuf_manage_new_length | ( | char * | str, |
size_t | length | ||
) |
Creates a new string buffer using the passed string.
The passed string is used directly as the buffer, it's somehow the opposite function of eina_strbuf_string_steal . The passed string must be malloced.
str | The string to manage |
length | The length of the string. |
This function creates a new string buffer. On error, NULL
is returned. To free the resources, use eina_strbuf_free().
Eina_Strbuf* eina_strbuf_manage_read_only_new_length | ( | const char * | str, |
size_t | length | ||
) |
Creates a new string buffer using the passed string.
The passed string is used directly as the buffer, it's somehow the opposite function of eina_strbuf_string_steal . The passed string must be malloced.
str | The string to manage |
length | The length of the string. |
This function creates a new string buffer. On error, NULL
is returned. To free the resources, use eina_strbuf_free().
void eina_strbuf_free | ( | Eina_Strbuf * | buf | ) |
Frees a string buffer.
buf | The string buffer to free. |
This function frees the memory of buf
. buf
must have been created by eina_strbuf_new().
Referenced by ecore_file_app_exe_get(), edje_available_modules_get(), edje_edit_color_classes_source_generate(), edje_edit_data_source_generate(), edje_edit_full_source_generate(), edje_edit_print_internal_status(), edje_edit_script_error_list_get(), edje_evas_global_perspective_get(), edje_init(), edje_object_part_text_escaped_set(), eina_simple_xml_node_dump(), elm_gengrid_item_class_unref(), elm_genlist_item_class_unref(), elm_theme_get(), evas_object_textblock_text_markup_get(), evas_textblock_cursor_content_get(), evas_textblock_style_set(), evas_textblock_text_markup_to_utf8(), and evas_textblock_text_utf8_to_markup().
void eina_strbuf_reset | ( | Eina_Strbuf * | buf | ) |
Resets a string buffer.
buf | The string buffer to reset. |
This function reset buf:
the buffer len is set to 0, and the string is set to '\0'. No memory is free'd.
Referenced by edje_available_modules_get(), and edje_evas_global_perspective_get().
Eina_Bool eina_strbuf_append | ( | Eina_Strbuf * | buf, |
const char * | str | ||
) |
Appends a string to a buffer, reallocating as necessary.
buf | The string buffer to append to. |
str | The string to append. |
This function appends str
to buf
. It computes the length of str
, so is slightly slower than eina_strbuf_append_length(). If the length is known beforehand, consider using that variant. If buf
can't append it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Referenced by ecore_file_app_exe_get(), edje_edit_color_classes_source_generate(), edje_evas_global_perspective_get(), edje_object_part_text_escaped_set(), elm_gengrid_item_class_unref(), elm_genlist_item_class_unref(), evas_object_textblock_text_markup_prepend(), and evas_textblock_text_markup_to_utf8().
Eina_Bool eina_strbuf_append_escaped | ( | Eina_Strbuf * | buf, |
const char * | str | ||
) |
Appends an escaped string to a buffer, reallocating as necessary.
buf | The string buffer to append to. |
str | The string to append. |
This function escapes and then appends the string str
to buf
. If str
can not be appended, EINA_FALSE is returned, otherwise, EINA_TRUE is returned.
Eina_Bool eina_strbuf_append_n | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
size_t | maxlen | ||
) |
Appends a string to a buffer, reallocating as necessary, limited by the given length.
buf | The string buffer to append to. |
str | The string to append. |
maxlen | The maximum number of characters to append. |
This function appends at most maxlen
characters of str
to buf
. It can't append more than the length of str
. It computes the length of str
, so it is slightly slower than eina_strbuf_append_length(). If the length is known beforehand, consider using that variant (maxlen
should then be checked so that it is greater than the size of str
). If str
can not be appended, EINA_FALSE is returned, otherwise, EINA_TRUE is returned.
Referenced by edje_object_part_text_escaped_set().
Eina_Bool eina_strbuf_append_length | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
size_t | length | ||
) |
Appends a string of exact length to a buffer, reallocating as necessary.
buf | The string buffer to append to. |
str | The string to append. |
length | The exact length to use. |
This function appends str
to buf
. str
must be of size at most length
. It is slightly faster than eina_strbuf_append() as it does not compute the size of str
. It is useful when dealing with strings of known size, such as eina_stringshare. If buf
can't append it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Referenced by edje_object_part_text_escaped_set(), eina_strbuf_append_vprintf(), evas_object_textblock_text_markup_prepend(), evas_textblock_style_set(), and evas_textblock_text_markup_to_utf8().
Eina_Bool eina_strbuf_append_slice | ( | Eina_Strbuf * | buf, |
const Eina_Slice | slice | ||
) |
Append a slice to a buffer, reallocating as necessary.
buf | The string buffer to append to. |
slice | The slice to append. |
This function appends slice
to buf
. If buf
can't append it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Eina_Bool eina_strbuf_append_buffer | ( | Eina_Strbuf * | buf, |
const Eina_Strbuf * | data | ||
) |
Appends an Eina_Strbuf to a buffer, reallocating as necessary.
buf | The string buffer to append to. |
data | The string buffer to append. |
This function appends data
to buf
. data
must be allocated and different from . It is slightly faster than eina_strbuf_append() as it does not compute the size of str
. If buf
can't append it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Eina_Bool eina_strbuf_append_char | ( | Eina_Strbuf * | buf, |
char | c | ||
) |
Appends a character to a string buffer, reallocating as necessary.
buf | The string buffer to append to. |
c | The char to append. |
This function inserts c
to buf
. If it can not insert it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Referenced by ecore_file_app_exe_get(), edje_object_part_text_escaped_set(), elm_theme_get(), evas_object_textblock_text_markup_prepend(), and evas_textblock_style_set().
Eina_Bool eina_strbuf_append_printf | ( | Eina_Strbuf * | buf, |
const char * | fmt, | ||
... | |||
) |
Appends a string to a buffer, reallocating as necessary.
buf | The string buffer to append to. |
fmt | The string to append. |
This function appends the string defined by the format fmt
to buf
. fmt
must be of a valid format for printf family of functions. If it can't insert it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Referenced by edje_available_modules_get(), edje_edit_color_classes_source_generate(), and edje_init().
Eina_Bool Eina_Bool eina_strbuf_append_vprintf | ( | Eina_Strbuf * | buf, |
const char * | fmt, | ||
va_list | args | ||
) |
Appends a string to a buffer, reallocating as necessary.
buf | The string buffer to append to. |
fmt | The string to append. |
args | The variable arguments. |
References EINA_FALSE, and eina_strbuf_append_length().
Eina_Bool eina_strbuf_insert | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
size_t | pos | ||
) |
Inserts a string to a buffer, reallocating as necessary.
buf | The string buffer to insert. |
str | The string to insert. |
pos | The position to insert the string. |
This function inserts str
to buf
at position pos
. It computes the length of str
, so is slightly slower than eina_strbuf_insert_length(). If the length is known beforehand, consider using that variant. If buf
can't insert it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Referenced by eina_strbuf_insert_vprintf().
Eina_Bool eina_strbuf_insert_escaped | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
size_t | pos | ||
) |
Inserts an escaped string to a buffer, reallocating as necessary.
buf | The string buffer to insert to. |
str | The string to insert. |
pos | The position to insert the string. |
This function escapes and inserts the string str
to buf
at position pos
. If buf
can't insert str
, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Eina_Bool eina_strbuf_insert_n | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
size_t | maxlen, | ||
size_t | pos | ||
) |
Inserts a string to a buffer, reallocating as necessary.
Limited by maxlen.
buf | The string buffer to insert to. |
str | The string to insert. |
maxlen | The maximum number of chars to insert. |
pos | The position to insert the string. |
This function inserts str
to buf
at position pos
, with at most maxlen
bytes. The number of inserted characters can not be greater than the length of str
. It computes the length of str
, so is slightly slower than eina_strbuf_insert_length(). If the length is known beforehand, consider using that variant (maxlen
should then be checked so that it is greater than the size of str
). If str
can not be inserted, EINA_FALSE is returned, otherwise, EINA_TRUE is returned.
Eina_Bool eina_strbuf_insert_length | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
size_t | length, | ||
size_t | pos | ||
) |
Inserts a string of exact length to a buffer, reallocating as necessary.
buf | The string buffer to insert to. |
str | The string to insert. |
length | The exact length to use. |
pos | The position to insert the string. |
This function inserts str
to buf
. str
must be of size at most length
. It is slightly faster than eina_strbuf_insert() as it does not compute the size of str
. It is useful when dealing with strings of known size, such as eina_strngshare. If buf
can't insert it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Eina_Bool eina_strbuf_insert_slice | ( | Eina_Strbuf * | buf, |
const Eina_Slice | slice, | ||
size_t | pos | ||
) |
Insert a slice to a buffer, reallocating as necessary.
buf | The string buffer to insert to. |
slice | The slice to insert. |
pos | The position to insert the string. |
This function inserts slice
to buf
at position pos
. If buf
can't insert it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Eina_Bool eina_strbuf_insert_char | ( | Eina_Strbuf * | buf, |
char | c, | ||
size_t | pos | ||
) |
Inserts a character to a string buffer, reallocating as necessary.
buf | The string buffer to insert to. |
c | The char to insert. |
pos | The position to insert the char. |
This function inserts c
to buf
at position pos
. If buf
can't append it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Eina_Bool eina_strbuf_insert_printf | ( | Eina_Strbuf * | buf, |
const char * | fmt, | ||
size_t | pos, | ||
... | |||
) |
Inserts a string to a buffer, reallocating as necessary.
buf | The string buffer to insert. |
fmt | The string to insert. |
pos | The position to insert the string. |
This function insert a string as described by the format fmt
to buf
at the position pos
. fmt
must be of a valid format for printf family of functions. If it can't insert it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Eina_Bool Eina_Bool eina_strbuf_insert_vprintf | ( | Eina_Strbuf * | buf, |
const char * | fmt, | ||
size_t | pos, | ||
va_list | args | ||
) |
Inserts a string to a buffer, reallocating as necessary.
buf | The string buffer to insert. |
fmt | The string to insert. |
pos | The position to insert the string. |
args | The variable arguments. |
References EINA_FALSE, and eina_strbuf_insert().
Eina_Bool eina_strbuf_remove | ( | Eina_Strbuf * | buf, |
size_t | start, | ||
size_t | end | ||
) |
Removes a slice of the given string buffer.
buf | The string buffer to remove a slice. |
start | The initial (inclusive) slice position to start removing, in bytes. |
end | The final (non-inclusive) slice position to finish removing, in bytes. |
This function removes a slice of buf
, starting at start
(inclusive) and ending at end
(non-inclusive). Both values are in bytes. It returns EINA_FALSE on failure, EINA_TRUE otherwise.
const char* eina_strbuf_string_get | ( | const Eina_Strbuf * | buf | ) |
Retrieves a pointer to the contents of a string buffer.
buf | The string buffer. |
This function returns the string contained in buf
. The returned value must not be modified and will no longer be valid if buf
is modified. In other words, any eina_strbuf_append() or similar will make that pointer invalid. The pointer returned by this function must not be freed.
Referenced by edje_available_modules_get(), edje_edit_color_classes_source_generate(), edje_edit_data_source_generate(), edje_edit_full_source_generate(), edje_evas_global_perspective_get(), edje_init(), edje_object_part_text_escaped_set(), eldbus_signal_handler_match_extra_vset(), eldbus_signal_handler_ref(), eldbus_signal_handler_unref(), elm_theme_get(), and evas_object_textblock_text_markup_get().
char* eina_strbuf_string_steal | ( | Eina_Strbuf * | buf | ) |
Steals the contents of a string buffer.
buf | The string buffer to steal. |
This function returns the string contained in buf
. buf
is then initialized and does not own the returned string anymore. The caller must release the memory of the returned string by calling free().
Referenced by ecore_file_app_exe_get(), edje_edit_full_source_generate(), edje_object_part_text_escaped_set(), eina_simple_xml_node_dump(), elm_gengrid_item_class_unref(), elm_genlist_item_class_unref(), evas_textblock_cursor_content_get(), evas_textblock_style_set(), evas_textblock_text_markup_to_utf8(), and evas_textblock_text_utf8_to_markup().
void eina_strbuf_string_free | ( | Eina_Strbuf * | buf | ) |
Frees the contents of a string buffer but not the buffer.
buf | The string buffer to free the string of. |
This function frees the string contained in buf
without freeing buf
.
size_t eina_strbuf_length_get | ( | const Eina_Strbuf * | buf | ) |
Retrieves the length of the string buffer content.
buf | The string buffer. |
This function returns the length of buf
.
Referenced by elm_gengrid_item_class_unref(), and elm_genlist_item_class_unref().
Eina_Bool eina_strbuf_replace | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
const char * | with, | ||
unsigned int | n | ||
) |
Replaces the n-th string with an other string.
buf | The string buffer to work with. |
str | The string to replace. |
with | The replacing string. |
n | The number of the fitting string. |
This function replaces the n-th occurrence of str
in buf
with with
. It returns EINA_FALSE on failure, EINA_TRUE otherwise.
int eina_strbuf_replace_all | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
const char * | with | ||
) |
Replaces all strings with an other string.
buf | The string buffer to work with. |
str | The string to replace. |
with | The replacing string. |
This function replaces all the occurrences of str
in buf
with the string with
. This function returns the number of times str
has been replaced. On failure, it returns 0
.
void eina_strbuf_trim | ( | Eina_Strbuf * | buf | ) |
Trims the string buffer.
buf | The string buffer to work with. |
This function skips whitespaces in the beginning and the end of the buffer.
void eina_strbuf_ltrim | ( | Eina_Strbuf * | buf | ) |
Left trims the string buffer.
buf | The string buffer to work with. |
This function skips whitespaces in the beginning of the buffer.
void eina_strbuf_rtrim | ( | Eina_Strbuf * | buf | ) |
Right trims the string buffer.
buf | The string buffer to work with. |
This function skips whitespaces in the end of the buffer.
void eina_strbuf_tolower | ( | Eina_Strbuf * | buf | ) |
Converts the string to lower case.
buf | The string buffer to work with. |
This function converts all the characters in the strbuf to lower case.
References eina_str_tolower().
Eina_Strbuf* eina_strbuf_substr_get | ( | Eina_Strbuf * | buf, |
size_t | pos, | ||
size_t | len | ||
) |
Obtains substring from the src.
buf | The src string. |
pos | The position in the source string from which the substring should be created. The first character is denoted by a value of 0 (not 1). |
len | The length from pos that should be copied to substring. |
This function creates a Eina_Strbuf which is a substring of buf which is passed from pos position with len length. If buf is NULL then returns NULL. If len is 0, then an empty strbuf is returned.
References eina_strbuf_manage_new().
Eina_Slice eina_strbuf_slice_get | ( | const Eina_Strbuf * | buf | ) |
Gets a read-only slice representing the current strbuf contents.
buf | The source string. |
Eina_Rw_Slice eina_strbuf_rw_slice_get | ( | const Eina_Strbuf * | buf | ) |
Gets a read-write slice representing the current strbuf contents.
buf | The source string. |
char* eina_strbuf_release | ( | Eina_Strbuf * | buf | ) |
Gets the string of the buffer and free the buffer.
buf | The buffer to get the string from and which will be freed |