libamxc
1.10.3
C Generic Data Containers
|
Functions | |
int | amxc_string_join_llist (amxc_string_t *string, const amxc_llist_t *list, char separator) |
Joins a list of amxc_string_t values into a single string with a separator. More... | |
int | amxc_string_join_var (amxc_string_t *string, const amxc_var_t *const var, const char *sep) |
Joins a variant containing a list of variants into a single string. More... | |
int | amxc_string_join_var_until (amxc_string_t *string, const amxc_var_t *const var, const char *sep, const char *end, bool remove) |
Joins a variant containing a list of variants into a single string until the end string is encountered . More... | |
int | amxc_string_csv_join_var (amxc_string_t *string, const amxc_var_t *const var) |
Joins a variant containing a list of variants into a single string using ',' as separator. More... | |
int | amxc_string_ssv_join_var (amxc_string_t *string, const amxc_var_t *const var) |
Joins a variant containing a list of variants into a single string using ' ' as separator. More... | |
When a list of strings or a list of variants is available they can be joined into a single string using one of these functions
int amxc_string_csv_join_var | ( | amxc_string_t * | string, |
const amxc_var_t *const | var | ||
) |
Joins a variant containing a list of variants into a single string using ',' as separator.
This function does the same as amxc_string_join_var and uses ',' as the value separator.
string | a pointer to a amxc_string_t structure, the joined string will be put in this string. |
var | The variant containing a linked list of variants |
Definition at line 164 of file amxc_string_join.c.
int amxc_string_join_llist | ( | amxc_string_t * | string, |
const amxc_llist_t * | list, | ||
char | separator | ||
) |
Joins a list of amxc_string_t values into a single string with a separator.
All amxc_string_t items in the linked list are joined into one amxc_string_t. A single character separator can be provided and will be put between all individual items.
string | a pointer to a amxc_string_t structure, the joined string will be put in this string. |
list | the linked list of strings |
separator | single character separator. |
Definition at line 69 of file amxc_string_join.c.
int amxc_string_join_var | ( | amxc_string_t * | string, |
const amxc_var_t *const | var, | ||
const char * | sep | ||
) |
Joins a variant containing a list of variants into a single string.
All variants in the linked list of variants are converted to a string and added to the result string. A separator string can be provided and will be put between the items.
If an item in the list is a variant containing a list, this list will be added as a string starting with '[' and ending with ']'. All items in that list are added as a string and separated with ','.
string | a pointer to a amxc_string_t structure, the joined string will be put in this string. |
var | The variant containing a linked list of variants |
sep | separator string. |
Definition at line 158 of file amxc_string_join.c.
int amxc_string_join_var_until | ( | amxc_string_t * | string, |
const amxc_var_t *const | var, | ||
const char * | sep, | ||
const char * | end, | ||
bool | remove | ||
) |
Joins a variant containing a list of variants into a single string until the end string is encountered .
All variants in the linked list of variants are converted to a string and added to the result string. A separator string can be provided and will be put between the items.
If an item in the list is a variant containing a list, this list will be added as a string starting with '[' and ending with ']'. All items in that list are added as a string and separated with ','.
When a variant in the list is encountered that after converting to a string matches the end string, joining is stopped. The end string itself is not added to the result string.
When remove is set to true, all variants used will be removed from the list of variants.
string | a pointer to a amxc_string_t structure, the joined string will be put in this string. |
var | The variant containing a linked list of variants |
sep | separator string or NULL |
end | end string or NULL |
remove | when set to true, all used variants are removed from the list. |
Definition at line 99 of file amxc_string_join.c.
int amxc_string_ssv_join_var | ( | amxc_string_t * | string, |
const amxc_var_t *const | var | ||
) |
Joins a variant containing a list of variants into a single string using ' ' as separator.
This function does the same as amxc_string_join_var and uses '' as the value separator.
string | a pointer to a amxc_string_t structure, the joined string will be put in this string. |
var | The variant containing a linked list of variants |
Definition at line 169 of file amxc_string_join.c.