Tizen Native API
|
Functions | |
Eina_Strbuf * | eina_strbuf_new (void) |
Create a new string buffer. | |
Eina_Strbuf * | eina_strbuf_manage_new (char *str) |
Create 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 * | eina_strbuf_manage_new_length (char *str, size_t length) |
Create a new string buffer using the passed string. The passed string is used directly as the buffer, it's somehow the opposite function of. | |
void | eina_strbuf_free (Eina_Strbuf *buf) |
Free a string buffer. | |
void | eina_strbuf_reset (Eina_Strbuf *buf) |
Reset a string buffer. | |
Eina_Bool | eina_strbuf_append (Eina_Strbuf *buf, const char *str) |
Append a string to a buffer, reallocating as necessary. | |
Eina_Bool | eina_strbuf_append_escaped (Eina_Strbuf *buf, const char *str) |
Append an escaped string to a buffer, reallocating as necessary. | |
Eina_Bool | eina_strbuf_append_n (Eina_Strbuf *buf, const char *str, size_t maxlen) |
Append a string to a buffer, reallocating as necessary, limited by the given length. | |
Eina_Bool | eina_strbuf_append_length (Eina_Strbuf *buf, const char *str, size_t length) |
Append a string of exact length to a buffer, reallocating as necessary. | |
Eina_Bool | eina_strbuf_append_char (Eina_Strbuf *buf, char c) |
Append a character to a string buffer, reallocating as necessary. | |
Eina_Bool | eina_strbuf_append_printf (Eina_Strbuf *buf, const char *fmt,...) |
Append a string to a buffer, reallocating as necessary. | |
Eina_Bool | eina_strbuf_append_vprintf (Eina_Strbuf *buf, const char *fmt, va_list args) |
Append a string to a buffer, reallocating as necessary. | |
Eina_Bool | eina_strbuf_insert (Eina_Strbuf *buf, const char *str, size_t pos) |
Insert a string to a buffer, reallocating as necessary. | |
Eina_Bool | eina_strbuf_insert_escaped (Eina_Strbuf *buf, const char *str, size_t pos) |
Insert an escaped string to a buffer, reallocating as necessary. | |
Eina_Bool | eina_strbuf_insert_n (Eina_Strbuf *buf, const char *str, size_t maxlen, size_t pos) |
Insert a string to a buffer, reallocating as necessary. Limited by maxlen. | |
Eina_Bool | eina_strbuf_insert_length (Eina_Strbuf *buf, const char *str, size_t length, size_t pos) |
Insert a string of exact length to a buffer, reallocating as necessary. | |
Eina_Bool | eina_strbuf_insert_char (Eina_Strbuf *buf, char c, size_t pos) |
Insert a character to a string buffer, reallocating as necessary. | |
Eina_Bool | eina_strbuf_insert_printf (Eina_Strbuf *buf, const char *fmt, size_t pos,...) |
Insert a string to a buffer, reallocating as necessary. | |
Eina_Bool | eina_strbuf_insert_vprintf (Eina_Strbuf *buf, const char *fmt, size_t pos, va_list args) |
Insert a string to a buffer, reallocating as necessary. | |
Eina_Bool | eina_strbuf_remove (Eina_Strbuf *buf, size_t start, size_t end) |
Remove a slice of the given string buffer. | |
const char * | eina_strbuf_string_get (const Eina_Strbuf *buf) |
Retrieve a pointer to the contents of a string buffer. | |
char * | eina_strbuf_string_steal (Eina_Strbuf *buf) |
Steal the contents of a string buffer. | |
void | eina_strbuf_string_free (Eina_Strbuf *buf) |
Free the contents of a string buffer but not the buffer. | |
size_t | eina_strbuf_length_get (const Eina_Strbuf *buf) |
Retrieve the length of the string buffer content. | |
Eina_Bool | eina_strbuf_replace (Eina_Strbuf *buf, const char *str, const char *with, unsigned int n) |
Replace the n-th string with an other string. | |
int | eina_strbuf_replace_all (Eina_Strbuf *buf, const char *str, const char *with) |
Replace all strings with an other string. | |
void | eina_strbuf_trim (Eina_Strbuf *buf) |
Trim the string buffer. | |
void | eina_strbuf_ltrim (Eina_Strbuf *buf) |
Left trim the string buffer. | |
void | eina_strbuf_rtrim (Eina_Strbuf *buf) |
Right trim the string buffer. | |
Typedefs | |
typedef struct _Eina_Strbuf | Eina_Strbuf |
Defines | |
#define | eina_strbuf_prepend(buf, str) eina_strbuf_insert(buf, str, 0) |
Prepend the given string to the given buffer. | |
#define | eina_strbuf_prepend_escaped(buf, str) eina_strbuf_insert_escaped(buf, str, 0) |
Prepend the given escaped string to the given buffer. | |
#define | eina_strbuf_prepend_n(buf, str, maxlen) eina_strbuf_insert_n(buf, str, maxlen, 0) |
Prepend the given escaped string to the given buffer. | |
#define | eina_strbuf_prepend_length(buf, str, length) eina_strbuf_insert_length(buf, str, length, 0) |
Prepend the given escaped string to the given buffer. | |
#define | eina_strbuf_prepend_char(buf, c) eina_strbuf_insert_char(buf, c, 0) |
Prepend the given character to the given buffer. | |
#define | eina_strbuf_prepend_printf(buf, fmt,...) eina_strbuf_insert_printf(buf, fmt, 0, ## __VA_ARGS__) |
Prepend the given string to the given buffer. | |
#define | eina_strbuf_prepend_vprintf(buf, fmt, args) eina_strbuf_insert_vprintf(buf, fmt, 0, args) |
Prepend the given string to the given buffer. | |
#define | eina_strbuf_replace_first(buf, str, with) eina_strbuf_replace(buf, str, with, 1) |
Prepend the given character to the given buffer. |
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 Documentation
#define eina_strbuf_prepend | ( | buf, | |
str | |||
) | eina_strbuf_insert(buf, str, 0) |
Prepend the given string to the given buffer.
- Since :
- 2.3
- Parameters:
-
buf The string buffer to prepend to. str The string to prepend.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
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_char | ( | buf, | |
c | |||
) | eina_strbuf_insert_char(buf, c, 0) |
Prepend the given character to the given buffer.
- Since :
- 2.3
- Parameters:
-
buf The string buffer to prepend to. c The character to prepend.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
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_escaped | ( | buf, | |
str | |||
) | eina_strbuf_insert_escaped(buf, str, 0) |
Prepend the given escaped string to the given buffer.
- Since :
- 2.3
- Parameters:
-
buf The string buffer to prepend to. str The string to prepend.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
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_length | ( | buf, | |
str, | |||
length | |||
) | eina_strbuf_insert_length(buf, str, length, 0) |
Prepend the given escaped string to the given buffer.
- Since :
- 2.3
- Parameters:
-
buf The string buffer to prepend to. str The string to prepend. length The exact length to use.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
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_n | ( | buf, | |
str, | |||
maxlen | |||
) | eina_strbuf_insert_n(buf, str, maxlen, 0) |
Prepend the given escaped string to the given buffer.
- Since :
- 2.3
- Parameters:
-
buf The string buffer to prepend to. str The string to prepend. maxlen The maximum number of chars to prepend.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
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_printf | ( | buf, | |
fmt, | |||
... | |||
) | eina_strbuf_insert_printf(buf, fmt, 0, ## __VA_ARGS__) |
Prepend the given string to the given buffer.
- Since :
- 2.3
- Parameters:
-
buf The string buffer to prepend to. fmt The string to prepend.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
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) |
Prepend the given string to the given buffer.
- Since :
- 2.3
- Parameters:
-
buf The string buffer to prepend to. fmt The string to prepend. args The variable arguments.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
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) |
Prepend the given character to the given buffer.
- Since :
- 2.3
- Parameters:
-
buf The string buffer to work with. str The string to replace. with The replaceing string.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
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.
Typedef Documentation
Type for a string buffer.
Function Documentation
Eina_Bool eina_strbuf_append | ( | Eina_Strbuf * | buf, |
const char * | str | ||
) |
Append a string to a buffer, reallocating as necessary.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to append to. [in] str The string to append.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function appends
str
tobuf
. It computes the length ofstr
, so is slightly slower than eina_strbuf_append_length(). If the length is known beforehand, consider using that variant. Ifbuf
can't append it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Eina_Bool eina_strbuf_append_char | ( | Eina_Strbuf * | buf, |
char | c | ||
) |
Append a character to a string buffer, reallocating as necessary.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to append to. [in] c The char to append.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function inserts
c
tobuf
. If it can not insert it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Eina_Bool eina_strbuf_append_escaped | ( | Eina_Strbuf * | buf, |
const char * | str | ||
) |
Append an escaped string to a buffer, reallocating as necessary.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to append to. [in] str The string to append.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function escapes and then appends the string
str
tobuf
. Ifstr
can not be appended, EINA_FALSE is returned, otherwise, EINA_TRUE is returned.
Eina_Bool eina_strbuf_append_length | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
size_t | length | ||
) |
Append a string of exact length to a buffer, reallocating as necessary.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to append to. [in] str The string to append. [in] length The exact length to use.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function appends
str
tobuf
.str
must be of size at mostlength
. It is slightly faster than eina_strbuf_append() as it does not compute the size ofstr
. It is useful when dealing with strings of known size, such as eina_stringshare. Ifbuf
can't append it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
- See also:
- eina_stringshare_length()
- eina_strbuf_append()
- eina_strbuf_append_n()
Eina_Bool eina_strbuf_append_n | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
size_t | maxlen | ||
) |
Append a string to a buffer, reallocating as necessary, limited by the given length.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to append to. [in] str The string to append. [in] maxlen The maximum number of characters to append.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function appends at most
maxlen
characters ofstr
tobuf
. It can't append more than the length ofstr
. It computes the length ofstr
, 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 ofstr
). Ifstr
can not be appended, EINA_FALSE is returned, otherwise, EINA_TRUE is returned.
Eina_Bool eina_strbuf_append_printf | ( | Eina_Strbuf * | buf, |
const char * | fmt, | ||
... | |||
) |
Append a string to a buffer, reallocating as necessary.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to append to. [in] fmt The string to append.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function appends the string defined by the format
fmt
tobuf
.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.
- See also:
- eina_strbuf_append()
Eina_Bool eina_strbuf_append_vprintf | ( | Eina_Strbuf * | buf, |
const char * | fmt, | ||
va_list | args | ||
) |
Append a string to a buffer, reallocating as necessary.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to append to. [in] fmt The string to append. [in] args The variable arguments.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- See also:
- eina_strbuf_append_printf()
void eina_strbuf_free | ( | Eina_Strbuf * | buf | ) |
Free a string buffer.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to free.
- Remarks:
- This function frees the memory of
buf
.buf
must have been created by eina_strbuf_new().
Eina_Bool eina_strbuf_insert | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
size_t | pos | ||
) |
Insert a string to a buffer, reallocating as necessary.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to insert. [in] str The string to insert. [in] pos The position to insert the string.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function inserts
str
tobuf
at positionpos
. It computes the length ofstr
, so is slightly slower than eina_strbuf_insert_length(). If the length is known beforehand, consider using that variant. Ifbuf
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 | ||
) |
Insert a character to a string buffer, reallocating as necessary.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to insert to. [in] c The char to insert. [in] pos The position to insert the char.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function inserts
c
tobuf
at positionpos
. Ifbuf
can't append it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
Eina_Bool eina_strbuf_insert_escaped | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
size_t | pos | ||
) |
Insert an escaped string to a buffer, reallocating as necessary.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to insert to. [in] str The string to insert. [in] pos The position to insert the string.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function escapes and inserts the string
str
tobuf
at positionpos
. Ifbuf
can't insertstr
, 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 | ||
) |
Insert a string of exact length to a buffer, reallocating as necessary.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to insert to. [in] str The string to insert. [in] length The exact length to use. [in] pos The position to insert the string.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function inserts
str
tobuf
.str
must be of size at mostlength
. It is slightly faster than eina_strbuf_insert() as it does not compute the size ofstr
. It is useful when dealing with strings of known size, such as eina_strngshare. Ifbuf
can't insert it, EINA_FALSE is returned, otherwise EINA_TRUE is returned.
- See also:
- eina_stringshare_length()
- eina_strbuf_insert()
- eina_strbuf_insert_n()
Eina_Bool eina_strbuf_insert_n | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
size_t | maxlen, | ||
size_t | pos | ||
) |
Insert a string to a buffer, reallocating as necessary. Limited by maxlen.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to insert to. [in] str The string to insert. [in] maxlen The maximum number of chars to insert. [in] pos The position to insert the string.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function inserts
str
tobuf
at positionpos
, with at mostmaxlen
bytes. The number of inserted characters can not be greater than the length ofstr
. It computes the length ofstr
, 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 ofstr
). Ifstr
can not be inserted, EINA_FALSE is returned, otherwise, EINA_TRUE is returned.
Eina_Bool eina_strbuf_insert_printf | ( | Eina_Strbuf * | buf, |
const char * | fmt, | ||
size_t | pos, | ||
... | |||
) |
Insert a string to a buffer, reallocating as necessary.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to insert. [in] fmt The string to insert. [in] pos The position to insert the string.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function insert a string as described by the format
fmt
tobuf
at the positionpos
.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_strbuf_insert_vprintf | ( | Eina_Strbuf * | buf, |
const char * | fmt, | ||
size_t | pos, | ||
va_list | args | ||
) |
Insert a string to a buffer, reallocating as necessary.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to insert. [in] fmt The string to insert. [in] pos The position to insert the string. [in] args The variable arguments.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- See also:
- eina_strbuf_insert_printf
size_t eina_strbuf_length_get | ( | const Eina_Strbuf * | buf | ) |
Retrieve the length of the string buffer content.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer.
- Returns:
- The current length of the string, in bytes.
- Remarks:
- This function returns the length of
buf
.
void eina_strbuf_ltrim | ( | Eina_Strbuf * | buf | ) |
Left trim the string buffer.
- Since :
- 2.3
- Parameters:
-
[in] buf the string buffer to work with.
- Remarks:
- This function skips whitespaces in the beginning of the buffer.
Eina_Strbuf* eina_strbuf_manage_new | ( | char * | str | ) |
Create a new string buffer using the passed string. The passed string is used directly as the buffer, it's somehow the opposite function of.
- Since :
- 2.3
eina_strbuf_string_steal . The passed string must be malloced.
- Parameters:
-
[in] str the string to manage
- Returns:
- Newly allocated string buffer instance.
- Remarks:
- This function creates a new string buffer. On error,
NULL
is returned. To free the resources, use eina_strbuf_free().
- Since (EFL) :
- 1.1.0
Eina_Strbuf* eina_strbuf_manage_new_length | ( | char * | str, |
size_t | length | ||
) |
Create a new string buffer using the passed string. The passed string is used directly as the buffer, it's somehow the opposite function of.
- Since :
- 2.3
eina_strbuf_string_steal . The passed string must be malloced.
- Parameters:
-
[in] str the string to manage [in] length the length of the string.
- Returns:
- Newly allocated string buffer instance.
- Remarks:
- This function creates a new string buffer. On error,
NULL
is returned. To free the resources, use eina_strbuf_free().
- See also:
- eina_strbuf_manage_new()
- Since (EFL) :
- 1.2.0
Eina_Strbuf* eina_strbuf_new | ( | void | ) |
Create a new string buffer.
- Since :
- 2.3
- Returns:
- Newly allocated string buffer instance.
- Remarks:
- This function creates a new string buffer. On error,
NULL
is returned. To free the resources, use eina_strbuf_free().
Eina_Bool eina_strbuf_remove | ( | Eina_Strbuf * | buf, |
size_t | start, | ||
size_t | end | ||
) |
Remove a slice of the given string buffer.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to remove a slice. [in] start The initial (inclusive) slice position to start removing, in bytes. [in] end The final (non-inclusive) slice position to finish removing, in bytes.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function removes a slice of
buf
, starting atstart
(inclusive) and ending atend
(non-inclusive). Both values are in bytes. It returns EINA_FALSE on failure, EINA_TRUE otherwise.
Eina_Bool eina_strbuf_replace | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
const char * | with, | ||
unsigned int | n | ||
) |
Replace the n-th string with an other string.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to work with. [in] str The string to replace. [in] with The replaceing string. [in] n The number of the fitting string.
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure.
- Remarks:
- This function replaces the n-th occurrence of
str
inbuf
withwith
. It returns EINA_FALSE on failure, EINA_TRUE otherwise.
int eina_strbuf_replace_all | ( | Eina_Strbuf * | buf, |
const char * | str, | ||
const char * | with | ||
) |
Replace all strings with an other string.
- Since :
- 2.3
- Parameters:
-
[in] buf the string buffer to work with. [in] str The string to replace. [in] with The replaceing string.
- Returns:
- How often the string was replaced.
- Remarks:
- This function replaces all the occurrences of
str
inbuf
with the stringwith
. This function returns the number of timesstr
has been replaced. On failure, it returns0
.
void eina_strbuf_reset | ( | Eina_Strbuf * | buf | ) |
Reset a string buffer.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to reset.
- Remarks:
- This function reset
buf:
the buffer len is set to 0, and the string is set to '\0'. No memory is free'd.
void eina_strbuf_rtrim | ( | Eina_Strbuf * | buf | ) |
Right trim the string buffer.
- Since :
- 2.3
- Parameters:
-
[in] buf the string buffer to work with.
- Remarks:
- This function skips whitespaces in the end of the buffer.
void eina_strbuf_string_free | ( | Eina_Strbuf * | buf | ) |
Free the contents of a string buffer but not the buffer.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to free the string of.
- Remarks:
- This function frees the string contained in
buf
without freeingbuf
.
const char* eina_strbuf_string_get | ( | const Eina_Strbuf * | buf | ) |
Retrieve a pointer to the contents of a string buffer.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer.
- Returns:
- The current string in the string buffer.
- Remarks:
- This function returns the string contained in
buf
. The returned value must not be modified and will no longer be valid ifbuf
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.
- See also:
- eina_strbuf_string_steal()
char* eina_strbuf_string_steal | ( | Eina_Strbuf * | buf | ) |
Steal the contents of a string buffer.
- Since :
- 2.3
- Parameters:
-
[in] buf The string buffer to steal.
- Returns:
- The current string in the string buffer.
- Remarks:
- 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().
- See also:
- eina_strbuf_string_get()
void eina_strbuf_trim | ( | Eina_Strbuf * | buf | ) |
Trim the string buffer.
- Since :
- 2.3
- Parameters:
-
[in] buf the string buffer to work with.
- Remarks:
- This function skips whitespaces in the beginning and the end of the buffer.