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:
cssval
char **explode::cssval(const char *str)
cssval2
char ***explode::cssval2(const char *str)
tokenstr
char **explode::tokenstr(char sep,const char *str,const char **tokens,char suffix)
Static Template Methods:
expl
template< class T > T **explode::expl(const T *sep,const T *str)
count
template< class T > int explode::count(T **explosion_parts)
destroy
template< class T > void explode::destroy(T **explosion_parts)
find
template< class T > int explode::find(const T *item,T **explosion_parts)
get
template< class T > T *explode::get(int index,T **explosion_parts)
Motivation
Static Methods
cssval
Explodes a combined css value string.
Signature:
char **explode::cssval(const char *str)
Parameters:
Return value:Pointer to a (null-terminated) series of pointers of the generated substrings.
cssval2
Explodes a combined css value string with optional slash separation for two dimensions. (Only the first slash is recognized as separator. The function will never return more than two blocks.)
Signature:
char ***explode::cssval2(const char *str)
Parameters:
Return value:...
cssval2_free
Frees substrings returned by function explode::cssval2().
Signature:
void explode::cssval2_free(char ***b)
Parameters:
| char *** | b | | Return value from function explode::cssval2(). |
prepare_cssvalradius4
Example: The string "5px 3px 2px / 1px 7px" is translated to "5px|1px 3px|7px 2px|1px 3px|7px".
This can be used to process the css value for the border-radius shorthand. The returned string contains pairs of radii of the four corners.
Signature:
char *explode::prepare_cssvalradius4(const char *str)
Parameters:
Return value:...
tokenstr
Explodes a string of concatenated tokens and strings.
This function may return a
NULL pointer, if no tokens or strings are fond.
Signature:
char **explode::tokenstr(char sep,const char *str,const char **tokens,char suffix)
Parameters:
| char | sep | | |
| const char * | str | | |
| const char ** | tokens | | |
| char | suffix | | |
Return value:...
Static Template Methods
expl
Explodes a string by a separator character.
Signature:
template< class T > T **explode::expl(const T *sep,const T *str)
Parameters:
| const T * | sep | [IN] | One or more separator characters (as null-terminated string). |
| const 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=explode::expl(",;","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=explode::expl("#","HELLO#WORLD#!");
The substrings are copied into one single buffer as illustrated below.
count
Counts the number of substrings generated by
expl().
Signature:
template< class T > int explode::count(T **explosion_parts)
Parameters:
| T ** | explosion_parts | [IN] | The pointers to substrings, as returned by explode(). |
Return value:The number of substrings.
destroy
Frees the buffers allocated by
expl().
Signature:
template< class T > void explode::destroy(T **explosion_parts)
Parameters:
| T ** | explosion_parts | [IN] | The pointers to substrings, as returned by explode(). |
find
Searches for a string within the list of substrings generated by
explode().
Signature:
template< class T > int explode::find(const T *item,T **explosion_parts)
Parameters:
| const T * | item | [IN] | the null-terminated string to be searched for within the substrings generated by explode(). |
| 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.
get
Returns the substring given by its index within the substrings generated by
explode().
Signature:
template< class T > T *explode::get(int index,T **explosion_parts)
Parameters:
| int | index | | a index position of a substring within the substrings generated by explode(). |
| 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.