This documentation describes the Prokee module interface.
Templates
Show templates with parameter T set to: (
T),
(
char),
(
char16_t),
(
char32_t),
(
wchar_t
)
Static Methods:
compare_cistr
int strman::compare_cistr(const char *a,const char *b)
isprefix_cistr
bool strman::isprefix_cistr(const char *prefix,const char *str)
issubstr_cistr
bool strman::issubstr_cistr(const char *sub,const char *str)
Static Template Methods:
explode
explode
char32_t **strman::explode(const char32_t *sep,const char32_t *str)
explode_count
int strman::explode_count(char32_t **explosion_parts)
explode_free
void strman::explode_free(char32_t **explosion_parts)
findItem
int strman::findItem(const char32_t *item,char32_t **explosion_parts)
getItem
char32_t *strman::getItem(int index,char32_t **explosion_parts)
level2
level2_create
char32_t **strman::level2_create(int ln,char32_t ***itemlist)
level2_free
void strman::level2_free(char32_t **itemlist)
level2_replaceItem_realloc
bool strman::level2_replaceItem_realloc(char32_t **itemlist,const char32_t *old_item,const char32_t *new_item)
level2_setItem_realloc
bool strman::level2_setItem_realloc(int itemid,char32_t **itemlist,const char32_t *item)
level2_setItem_malloc
bool strman::level2_setItem_malloc(int itemid,char32_t **itemlist,const char32_t *item)
level2_freeItem
bool strman::level2_freeItem(int itemid,char32_t **itemlist)
nvlist
nvlist_create
bool strman::nvlist_create(char32_t ***names,char32_t ***values,int ln)
nvlist_free
void strman::nvlist_free(char32_t **names,char32_t **values)
nvlist_add
bool strman::nvlist_add(char32_t **names,char32_t **values,const char32_t *item_name)
nvlist_add_if_missing
bool strman::nvlist_add_if_missing(char32_t **names,char32_t **values,const char32_t *item_name)
nvlist_remove
bool strman::nvlist_remove(char32_t **names,char32_t **values,const char32_t *item_name)
nvlist_get
char32_t *strman::nvlist_get(char32_t **names,char32_t **values,const char32_t *item_name)
nvlist_set
bool strman::nvlist_set(char32_t **names,char32_t **values,const char32_t *item_name,const char32_t *item_value)
nvlist_print_all
void strman::nvlist_print_all(char32_t **names,char32_t **values)
multistr
nullconcat
char32_t *strman::nullconcat(char32_t *a,char32_t *b)
nullcopy
char32_t *strman::nullcopy(char32_t *a,char32_t *b)
nullcopy_new
char32_t *strman::nullcopy_new(char32_t **a,char32_t *b)
isprefix, issuffix, ...
isprefix
bool strman::isprefix(const char32_t *a,const char32_t *b)
issuffix
bool strman::issuffix(const char32_t *a,const char32_t *b)
issubstr
bool strman::issubstr(const char32_t *a,const char32_t *b)
findsubstr
unsigned int strman::findsubstr(const char32_t *a,const char32_t *b)
substrmatch
bool strman::substrmatch(const char32_t *searchpat,const char32_t *text)
matchpat
bool strman::matchpat(char32_t *a,char32_t *b)
matchpat_i
bool strman::matchpat_i(char32_t *a,char32_t *b,unsigned int pos_a,unsigned int pos_b)
matchsymbol
matchsymbol (version 1)
bool strman::matchsymbol(const char32_t *str,size_t pos_in_str,const char32_t *symbols0,const char32_t *symbols1)
matchsymbol (version 2)
bool strman::matchsymbol(const char32_t *str,size_t pos_in_str,const char32_t *symbols0,const char32_t *symbols1,const char32_t *symbols2)
matchsymbol (version 3)
bool strman::matchsymbol(const char32_t *str,size_t pos_in_str,const char32_t *symbols0,const char32_t *symbols1,const char32_t *symbols2,const char32_t *symbols3)
Static Methods
toupper_str
Converts a ASCII string to uppercase.
Signature:
char *strman::toupper_str(char *str)
Parameters:
| char * | str | [IN/OUT] | Has to be a null-terminated ASCII string. |
Return value:Returns
str.
tolower_str
Converts a ASCII string to lowercase.
Signature:
char *strman::tolower_str(char *str)
Parameters:
| char * | str | [IN/OUT] | Has to be a null-terminated ASCII string. |
Return value:Returns
str.
compare_cistr
Case insensitive comparison of two ASCII string.
Signature:
int strman::compare_cistr(const char *a,const char *b)
Parameters:
| const char * | a | [IN] | Has to be a null-terminated ASCII string. |
| const char * | b | [IN] | Has to be a null-terminated ASCII string. |
Return value:Returns 0 if both strings are equal and a value other than 0 otherwise.
isprefix_cistr
Case insensitive test, if
prefix is prefix of
str. Both strings have to be ASCII strings.
Signature:
bool strman::isprefix_cistr(const char *prefix,const char *str)
Parameters:
| const char * | prefix | [IN] | Has to be a null-terminated ASCII string. |
| const char * | str | [IN] | Has to be a null-terminated ASCII string. |
issubstr_cistr
Case insensitive test, if
sub is a substring of
str. Both strings have to be ASCII strings.
Signature:
bool strman::issubstr_cistr(const char *sub,const char *str)
Parameters:
| const char * | sub | [IN] | Has to be a null-terminated ASCII string. |
| const char * | str | [IN] | Has to be a null-terminated ASCII string. |
Static Template Methods
explode
Explodes a string by a separator character.
Signature:
char32_t **strman::explode(const char32_t *sep,const char32_t *str)
Parameters:
| const char32_t * | sep | [IN] | One or more separator characters (as null-terminated string). |
| const char32_t * | str | [IN] | The null-terminated string to be exploded. |
Return value:Pointer to a (null-terminated) series of pointers of the generated substrings.
Remarks:
If more than one separator character is provided, the string is splitted on all occurrences of any of the given separator characters.

All generated substrings are copied into one single and new allocated buffer. The original string
str will remain unchanged. Use
explode_free to free all memory allocated by this method.
Examples:
1)
char **a=strman::explode(",;","red, green, blue,,orange;black;");
The array
a will then contain the following substrings:
a[0]=="red"
a[1]==" green" //spaces are preserved
a[2]==" blue"
a[3]=="" //empty strings do also count
a[4]=="orange"
a[5]=="black"
a[6]=="" //a separator character at the beginning or at the and of the string will produce an additional empty string.
a[7]==null //the array of pointers is terminated by a NULL-pointer.
In this example
explode_count(a) will return 7.

2)
char **a=strman::explode("#","HELLO#WORLD#!");
The substrings are copied into one single buffer as illustrated below.
explode_count
Counts the number of substrings generated by
explode().
Signature:
int strman::explode_count(char32_t **explosion_parts)
Parameters:
| char32_t ** | explosion_parts | [IN] | The pointers to substrings, as returned by explode(). |
Return value:The number of substrings.
explode_free
Frees the buffers allocated by
explode().
Signature:
void strman::explode_free(char32_t **explosion_parts)
Parameters:
| char32_t ** | explosion_parts | [IN] | The pointers to substrings, as returned by explode(). |
findItem
Searches for a string within the list of substrings generated by
explode().
Signature:
int strman::findItem(const char32_t *item,char32_t **explosion_parts)
Parameters:
| const char32_t * | item | [IN] | the null-terminated string to be searched for within the substrings generated by explode(). |
| char32_t ** | explosion_parts | [IN] | The pointers to substrings, as returned by explode(). |
Return value:The index of the first match. If no match is found, the function returns -1.
Remarks:
Only the first occurrence of the string is returned by this function.
getItem
Returns the substring given by its index within the substrings generated by
explode().
Signature:
char32_t *strman::getItem(int index,char32_t **explosion_parts)
Parameters:
| int | index | | a index position of a substring within the substrings generated by explode(). |
| char32_t ** | explosion_parts | [IN] | The pointers to substrings, as returned by explode(). |
Return value:A pointer to the substring given by its index position.
Remarks:
The function performs a range check for the given index. If the index is out of range, the function returns 0.
level2_create
Signature:
char32_t **strman::level2_create(int ln,char32_t ***itemlist)
Parameters:
| int | ln | | ln |
| char32_t *** | itemlist | [IN] | itemlist |
Examples:
1)
char **itemlist;
strman::level2_create(3,&itemlist);
strman::level2_addItem_malloc(itemlist,"HELLO");
strman::level2_addItem_malloc(itemlist,"WORLD");
strman::level2_addItem_malloc(itemlist,"!");
Memory is allocated for each string as illustrated below. Mind the difference to the result of
explode().
level2_free
Signature:
void strman::level2_free(char32_t **itemlist)
Parameters:
| char32_t ** | itemlist | [IN] | itemlist |
level2_replaceItem_realloc
Signature:
bool strman::level2_replaceItem_realloc(char32_t **itemlist,const char32_t *old_item,const char32_t *new_item)
Parameters:
| char32_t ** | itemlist | [IN] | itemlist |
| const char32_t * | old_item | [IN] | old_item |
| const char32_t * | new_item | [IN] | new_item |
level2_setItem_realloc
Signature:
bool strman::level2_setItem_realloc(int itemid,char32_t **itemlist,const char32_t *item)
Parameters:
| int | itemid | | itemid |
| char32_t ** | itemlist | [IN] | itemlist |
| const char32_t * | item | [IN] | item |
level2_setItem_malloc
Signature:
bool strman::level2_setItem_malloc(int itemid,char32_t **itemlist,const char32_t *item)
Parameters:
| int | itemid | | itemid |
| char32_t ** | itemlist | [IN] | itemlist |
| const char32_t * | item | [IN] | item |
level2_addItem_malloc
Signature:
bool strman::level2_addItem_malloc(char32_t **itemlist,const char32_t *item)
Parameters:
| char32_t ** | itemlist | [IN] | itemlist |
| const char32_t * | item | [IN] | item |
level2_freeItem
Signature:
bool strman::level2_freeItem(int itemid,char32_t **itemlist)
Parameters:
| int | itemid | | itemid |
| char32_t ** | itemlist | [IN] | itemlist |
nvlist_create
Signature:
bool strman::nvlist_create(char32_t ***names,char32_t ***values,int ln)
Parameters:
| char32_t *** | names | [IN] | names |
| char32_t *** | values | [IN] | values |
| int | ln | | ln |
nvlist_free
Signature:
void strman::nvlist_free(char32_t **names,char32_t **values)
Parameters:
| char32_t ** | names | [IN] | names |
| char32_t ** | values | [IN] | values |
nvlist_add
Signature:
bool strman::nvlist_add(char32_t **names,char32_t **values,const char32_t *item_name)
Parameters:
| char32_t ** | names | [IN] | names |
| char32_t ** | values | [IN] | values |
| const char32_t * | item_name | [IN] | item_name |
nvlist_add_if_missing
Signature:
bool strman::nvlist_add_if_missing(char32_t **names,char32_t **values,const char32_t *item_name)
Parameters:
| char32_t ** | names | [IN] | names |
| char32_t ** | values | [IN] | values |
| const char32_t * | item_name | [IN] | item_name |
nvlist_remove
Signature:
bool strman::nvlist_remove(char32_t **names,char32_t **values,const char32_t *item_name)
Parameters:
| char32_t ** | names | [IN] | names |
| char32_t ** | values | [IN] | values |
| const char32_t * | item_name | [IN] | item_name |
nvlist_get
Signature:
char32_t *strman::nvlist_get(char32_t **names,char32_t **values,const char32_t *item_name)
Parameters:
| char32_t ** | names | [IN] | names |
| char32_t ** | values | [IN] | values |
| const char32_t * | item_name | [IN] | item_name |
nvlist_set
Signature:
bool strman::nvlist_set(char32_t **names,char32_t **values,const char32_t *item_name,const char32_t *item_value)
Parameters:
| char32_t ** | names | [IN] | names |
| char32_t ** | values | [IN] | values |
| const char32_t * | item_name | [IN] | item_name |
| const char32_t * | item_value | [IN] | item_value |
nvlist_print_all
Signature:
void strman::nvlist_print_all(char32_t **names,char32_t **values)
Parameters:
| char32_t ** | names | [IN] | names |
| char32_t ** | values | [IN] | values |
nullconcat
Signature:
char32_t *strman::nullconcat(char32_t *a,char32_t *b)
Parameters:
| char32_t * | a | [IN] | a |
| char32_t * | b | [IN] | b |
nullcopy
Signature:
char32_t *strman::nullcopy(char32_t *a,char32_t *b)
Parameters:
| char32_t * | a | [IN] | a |
| char32_t * | b | [IN] | b |
nullcopy_new
Signature:
char32_t *strman::nullcopy_new(char32_t **a,char32_t *b)
Parameters:
| char32_t ** | a | [IN] | a |
| char32_t * | b | [IN] | b |
isprefix
Signature:
bool strman::isprefix(const char32_t *a,const char32_t *b)
Parameters:
| const char32_t * | a | [IN] | a |
| const char32_t * | b | [IN] | b |
issuffix
Signature:
bool strman::issuffix(const char32_t *a,const char32_t *b)
Parameters:
| const char32_t * | a | [IN] | a |
| const char32_t * | b | [IN] | b |
issubstr
Signature:
bool strman::issubstr(const char32_t *a,const char32_t *b)
Parameters:
| const char32_t * | a | [IN] | a |
| const char32_t * | b | [IN] | b |
findsubstr
Signature:
unsigned int strman::findsubstr(const char32_t *a,const char32_t *b)
Parameters:
| const char32_t * | a | [IN] | a |
| const char32_t * | b | [IN] | b |
substrmatch
Signature:
bool strman::substrmatch(const char32_t *searchpat,const char32_t *text)
Parameters:
| const char32_t * | searchpat | [IN] | searchpat |
| const char32_t * | text | [IN] | text |
matchpat
Signature:
bool strman::matchpat(char32_t *a,char32_t *b)
Parameters:
| char32_t * | a | [IN] | a |
| char32_t * | b | [IN] | b |
matchpat_i
Signature:
bool strman::matchpat_i(char32_t *a,char32_t *b,unsigned int pos_a,unsigned int pos_b)
Parameters:
| char32_t * | a | [IN] | a |
| char32_t * | b | [IN] | b |
| unsigned int | pos_a | | pos_a |
| unsigned int | pos_b | | pos_b |
matchsymbol (version 0)
Checks if the character at position
pos_in_str in string
str matches with one of the symbols in the string
symbols.
Signature:
bool strman::matchsymbol(const char32_t *str,size_t pos_in_str,const char32_t *symbols)
Parameters:
| const char32_t * | str | [IN] | a null-terminated string. |
| size_t | pos_in_str | | index within the string str. |
| const char32_t * | symbols | [IN] | a null-terminated string. |
Return value:Returns
true, if a match is found and
false otherwise.
matchsymbol (version 1)
Checks if the character at position
pos_in_str in string
str matches with one of the symbols in the strings
symbols0 or
symbols1.
Signature:
bool strman::matchsymbol(const char32_t *str,size_t pos_in_str,const char32_t *symbols0,const char32_t *symbols1)
Parameters:
| const char32_t * | str | [IN] | a null-terminated string. |
| size_t | pos_in_str | | index within the string str. |
| const char32_t * | symbols0 | [IN] | a null-terminated string. |
| const char32_t * | symbols1 | [IN] | a null-terminated string. |
Return value:Returns
true, if a match is found and
false otherwise.
matchsymbol (version 2)
Checks if the character at position
pos_in_str in string
str matches with one of the symbols in the strings
symbols0,
symbols1 or
symbols2.
Signature:
bool strman::matchsymbol(const char32_t *str,size_t pos_in_str,const char32_t *symbols0,const char32_t *symbols1,const char32_t *symbols2)
Parameters:
| const char32_t * | str | [IN] | a null-terminated string. |
| size_t | pos_in_str | | index within the string str. |
| const char32_t * | symbols0 | [IN] | a null-terminated string. |
| const char32_t * | symbols1 | [IN] | a null-terminated string. |
| const char32_t * | symbols2 | [IN] | a null-terminated string. |
Return value:Returns
true, if a match is found and
false otherwise.
matchsymbol (version 3)
Checks if the character at position
pos_in_str in string
str matches with one of the symbols in the strings
symbols0,
symbols1,
symbols2 or
symbols3.
Signature:
bool strman::matchsymbol(const char32_t *str,size_t pos_in_str,const char32_t *symbols0,const char32_t *symbols1,const char32_t *symbols2,const char32_t *symbols3)
Parameters:
| const char32_t * | str | [IN] | a null-terminated string. |
| size_t | pos_in_str | | index within the string str. |
| const char32_t * | symbols0 | [IN] | a null-terminated string. |
| const char32_t * | symbols1 | [IN] | a null-terminated string. |
| const char32_t * | symbols2 | [IN] | a null-terminated string. |
| const char32_t * | symbols3 | [IN] | a null-terminated string. |
Return value:Returns
true, if a match is found and
false otherwise.