eina_strbuf_01.c
//Compile with:
//gcc -Wall -o eina_strbuf_01 eina_strbuf_01.c `pkg-config --cflags --libs eina`
#include <stdio.h>
#include <Eina.h>
int main(int argc, char **argv)
{
Eina_Strbuf *buf;
eina_init();
buf = eina_strbuf_new();
printf("%s\n", eina_strbuf_string_get(buf));
eina_strbuf_reset(buf);
printf("%s\n", eina_strbuf_string_get(buf));
eina_strbuf_reset(buf);
printf("%s\n", eina_strbuf_string_get(buf));
eina_strbuf_remove(buf, 0, 7);
printf("%s\n", eina_strbuf_string_get(buf));
printf("%s\n", eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
return 0;
}
Eina Utility library.
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_append_escaped(Eina_Strbuf *buf, const char *str)
Append an escaped string to a buffer, reallocating as necessary.
Eina_Bool eina_strbuf_append_printf(Eina_Strbuf *buf, const char *fmt,...) EINA_PRINTF(2
Append a string 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_insert_printf(Eina_Strbuf *buf, const char *fmt, size_t pos,...) EINA_PRINTF(2
Insert a string to a buffer, reallocating as necessary.
const char * eina_strbuf_string_get(const Eina_Strbuf *buf)
Retrieve a pointer to the contents of a string buffer.
size_t eina_strbuf_length_get(const Eina_Strbuf *buf)
Retrieve the length of the string buffer content.
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.
int eina_strbuf_replace_all(Eina_Strbuf *buf, const char *str, const char *with)
Replace all strings with an other string.
Definition eina_strbuf_common.c:801
Eina_Bool eina_strbuf_remove(Eina_Strbuf *buf, size_t start, size_t end)
Remove a slice of the given string buffer.