String library.
Structs
-------
String (str.h)
WString (wstr.h)
Functions
---------
String* str_empty();
String* str_init(unsigned initial_size);
String* str_from_cstr(const char *src, unsigned n);
void str_reserve(String *str, unsigned n);
int str_concat_cstr(String *str, const char *cat, unsigned n);
int str_concat_str(String *str, String *cat);
int str_push_char(String *str, char c);
int str_remove_at(String *str, unsigned index);
int str_remove_range(String *str, unsigned start, unsigned end);
char str_get_at(String *str, unsigned index);
int str_set_at(String *str, unsigned index, char c);
int str_insert(String *str, const char *insert, unsigned n, unsigned index);
char* str_to_cstr(String *str);
char* str_substring(String *str, unsigned start, unsigned end);
String* str_dup(String *str);
const char* str_get_buffer(String *str);
size_t str_length(String *str);
char* str_tok(String *str, char *tokens);
int str_transform(String *str, char(*func)(char));
void str_shrink(String *str);
void str_clear(String *str);
void str_free(String *str);
Note:
The same functions are available for wide strings.
Replace "str" with "wstr", "String" with "WString", "cstr" with "cwstr" and "char" with "wchar_t"
Building
--------
make: build the library
make install: install the library. Default path: /usr/local, can be modified changing INSTALL_PATH (make install INSTALL_PATH=/usr)
make uninstall: uninstall the library. INSTALL_PATH must be the same as on instalation.
make doxygen: Build doxygen documentation in the ./doxygen folder.
make clean: Cleans binary files