This documenta- tion describes the current state of development.
Note that interfaces and functionality may still change.

Prokee Modules:
  A
  B
  C
  D
  E
  F
  G
  I
  L
  M
  N
  O
  P
  R
  S
  T
  U
  W

     open all    |    close all

GUI Elements:
  B
  C
  I
  M
  P
  R
  S
  T

     open all    |    close all

GUI Interactions:
  B
  F
  H
  S

     open all    |    close all

GUI Layouts:
  L

     open all    |    close all

Games/Demos:
  M

     open all    |    close all

Third Party Libraries:
  P
  F
  Z

     open all    |    close all

Information about this Website / Informationen zu dieser Webseite:
In case of any questions, or comments, please feel free to contact me via email at apoll500@gmail.com.

Module strman [Version: v01]

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:
toupper_str
char *strman::toupper_str(char *str)
tolower_str
char *strman::tolower_str(char *str)
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
wchar_t **strman::explode(const wchar_t *sep,const wchar_t *str)
explode_count
int strman::explode_count(wchar_t **explosion_parts)
explode_free
void strman::explode_free(wchar_t **explosion_parts)
findItem
int strman::findItem(const wchar_t *item,wchar_t **explosion_parts)
getItem
wchar_t *strman::getItem(int index,wchar_t **explosion_parts)
level2
level2_create
wchar_t **strman::level2_create(int ln,wchar_t ***itemlist)
level2_free
void strman::level2_free(wchar_t **itemlist)
level2_replaceItem_realloc
bool strman::level2_replaceItem_realloc(wchar_t **itemlist,const wchar_t *old_item,const wchar_t *new_item)
level2_setItem_realloc
bool strman::level2_setItem_realloc(int itemid,wchar_t **itemlist,const wchar_t *item)
level2_setItem_malloc
bool strman::level2_setItem_malloc(int itemid,wchar_t **itemlist,const wchar_t *item)
level2_addItem_malloc
bool strman::level2_addItem_malloc(wchar_t **itemlist,const wchar_t *item)
level2_freeItem
bool strman::level2_freeItem(int itemid,wchar_t **itemlist)
nvlist
nvlist_create
bool strman::nvlist_create(wchar_t ***names,wchar_t ***values,int ln)
nvlist_free
void strman::nvlist_free(wchar_t **names,wchar_t **values)
nvlist_add
bool strman::nvlist_add(wchar_t **names,wchar_t **values,const wchar_t *item_name)
nvlist_add_if_missing
bool strman::nvlist_add_if_missing(wchar_t **names,wchar_t **values,const wchar_t *item_name)
nvlist_remove
bool strman::nvlist_remove(wchar_t **names,wchar_t **values,const wchar_t *item_name)
nvlist_get
wchar_t *strman::nvlist_get(wchar_t **names,wchar_t **values,const wchar_t *item_name)
nvlist_set
bool strman::nvlist_set(wchar_t **names,wchar_t **values,const wchar_t *item_name,const wchar_t *item_value)
nvlist_print_all
void strman::nvlist_print_all(wchar_t **names,wchar_t **values)
multistr
nullconcat
wchar_t *strman::nullconcat(wchar_t *a,wchar_t *b)
nullcopy
wchar_t *strman::nullcopy(wchar_t *a,wchar_t *b)
nullcopy_new
wchar_t *strman::nullcopy_new(wchar_t **a,wchar_t *b)
isprefix, issuffix, ...
isprefix
bool strman::isprefix(const wchar_t *a,const wchar_t *b)
issuffix
bool strman::issuffix(const wchar_t *a,const wchar_t *b)
issubstr
bool strman::issubstr(const wchar_t *a,const wchar_t *b)
findsubstr
unsigned int strman::findsubstr(const wchar_t *a,const wchar_t *b)
substrmatch
bool strman::substrmatch(const wchar_t *searchpat,const wchar_t *text)
matchpat
bool strman::matchpat(wchar_t *a,wchar_t *b)
matchpat_i
bool strman::matchpat_i(wchar_t *a,wchar_t *b,unsigned int pos_a,unsigned int pos_b)
matchsymbol
matchsymbol (version 0)
bool strman::matchsymbol(const wchar_t *str,size_t pos_in_str,const wchar_t *symbols)
matchsymbol (version 1)
bool strman::matchsymbol(const wchar_t *str,size_t pos_in_str,const wchar_t *symbols0,const wchar_t *symbols1)
matchsymbol (version 2)
bool strman::matchsymbol(const wchar_t *str,size_t pos_in_str,const wchar_t *symbols0,const wchar_t *symbols1,const wchar_t *symbols2)
matchsymbol (version 3)
bool strman::matchsymbol(const wchar_t *str,size_t pos_in_str,const wchar_t *symbols0,const wchar_t *symbols1,const wchar_t *symbols2,const wchar_t *symbols3)

Static Methods

   toupper_str


Converts a ASCII string to uppercase.

Signature:
char *strman::toupper_str(char *str)

Parameters:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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:
wchar_t **strman::explode(const wchar_t *sep,const wchar_t *str)

Parameters:
Type Name Direction Description
const wchar_t *sep[IN]One or more separator characters (as null-terminated string).
const wchar_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(wchar_t **explosion_parts)

Parameters:
Type Name Direction Description
wchar_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(wchar_t **explosion_parts)

Parameters:
Type Name Direction Description
wchar_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 wchar_t *item,wchar_t **explosion_parts)

Parameters:
Type Name Direction Description
const wchar_t *item[IN]the null-terminated string to be searched for within the substrings generated by explode().
wchar_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:
wchar_t *strman::getItem(int index,wchar_t **explosion_parts)

Parameters:
Type Name Direction Description
int indexa index position of a substring within the substrings generated by explode().
wchar_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:
wchar_t **strman::level2_create(int ln,wchar_t ***itemlist)

Parameters:
Type Name Direction Description
int lnln
wchar_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(wchar_t **itemlist)

Parameters:
Type Name Direction Description
wchar_t **itemlist[IN]itemlist

   level2_replaceItem_realloc


Signature:
bool strman::level2_replaceItem_realloc(wchar_t **itemlist,const wchar_t *old_item,const wchar_t *new_item)

Parameters:
Type Name Direction Description
wchar_t **itemlist[IN]itemlist
const wchar_t *old_item[IN]old_item
const wchar_t *new_item[IN]new_item

   level2_setItem_realloc


Signature:
bool strman::level2_setItem_realloc(int itemid,wchar_t **itemlist,const wchar_t *item)

Parameters:
Type Name Direction Description
int itemiditemid
wchar_t **itemlist[IN]itemlist
const wchar_t *item[IN]item

   level2_setItem_malloc


Signature:
bool strman::level2_setItem_malloc(int itemid,wchar_t **itemlist,const wchar_t *item)

Parameters:
Type Name Direction Description
int itemiditemid
wchar_t **itemlist[IN]itemlist
const wchar_t *item[IN]item

   level2_addItem_malloc


Signature:
bool strman::level2_addItem_malloc(wchar_t **itemlist,const wchar_t *item)

Parameters:
Type Name Direction Description
wchar_t **itemlist[IN]itemlist
const wchar_t *item[IN]item

   level2_freeItem


Signature:
bool strman::level2_freeItem(int itemid,wchar_t **itemlist)

Parameters:
Type Name Direction Description
int itemiditemid
wchar_t **itemlist[IN]itemlist

   nvlist_create


Signature:
bool strman::nvlist_create(wchar_t ***names,wchar_t ***values,int ln)

Parameters:
Type Name Direction Description
wchar_t ***names[IN]names
wchar_t ***values[IN]values
int lnln

   nvlist_free


Signature:
void strman::nvlist_free(wchar_t **names,wchar_t **values)

Parameters:
Type Name Direction Description
wchar_t **names[IN]names
wchar_t **values[IN]values

   nvlist_add


Signature:
bool strman::nvlist_add(wchar_t **names,wchar_t **values,const wchar_t *item_name)

Parameters:
Type Name Direction Description
wchar_t **names[IN]names
wchar_t **values[IN]values
const wchar_t *item_name[IN]item_name

   nvlist_add_if_missing


Signature:
bool strman::nvlist_add_if_missing(wchar_t **names,wchar_t **values,const wchar_t *item_name)

Parameters:
Type Name Direction Description
wchar_t **names[IN]names
wchar_t **values[IN]values
const wchar_t *item_name[IN]item_name

   nvlist_remove


Signature:
bool strman::nvlist_remove(wchar_t **names,wchar_t **values,const wchar_t *item_name)

Parameters:
Type Name Direction Description
wchar_t **names[IN]names
wchar_t **values[IN]values
const wchar_t *item_name[IN]item_name

   nvlist_get


Signature:
wchar_t *strman::nvlist_get(wchar_t **names,wchar_t **values,const wchar_t *item_name)

Parameters:
Type Name Direction Description
wchar_t **names[IN]names
wchar_t **values[IN]values
const wchar_t *item_name[IN]item_name

   nvlist_set


Signature:
bool strman::nvlist_set(wchar_t **names,wchar_t **values,const wchar_t *item_name,const wchar_t *item_value)

Parameters:
Type Name Direction Description
wchar_t **names[IN]names
wchar_t **values[IN]values
const wchar_t *item_name[IN]item_name
const wchar_t *item_value[IN]item_value

   nvlist_print_all


Signature:
void strman::nvlist_print_all(wchar_t **names,wchar_t **values)

Parameters:
Type Name Direction Description
wchar_t **names[IN]names
wchar_t **values[IN]values

   nullconcat


Signature:
wchar_t *strman::nullconcat(wchar_t *a,wchar_t *b)

Parameters:
Type Name Direction Description
wchar_t *a[IN]a
wchar_t *b[IN]b

   nullcopy


Signature:
wchar_t *strman::nullcopy(wchar_t *a,wchar_t *b)

Parameters:
Type Name Direction Description
wchar_t *a[IN]a
wchar_t *b[IN]b

   nullcopy_new


Signature:
wchar_t *strman::nullcopy_new(wchar_t **a,wchar_t *b)

Parameters:
Type Name Direction Description
wchar_t **a[IN]a
wchar_t *b[IN]b

   isprefix


Signature:
bool strman::isprefix(const wchar_t *a,const wchar_t *b)

Parameters:
Type Name Direction Description
const wchar_t *a[IN]a
const wchar_t *b[IN]b

   issuffix


Signature:
bool strman::issuffix(const wchar_t *a,const wchar_t *b)

Parameters:
Type Name Direction Description
const wchar_t *a[IN]a
const wchar_t *b[IN]b

   issubstr


Signature:
bool strman::issubstr(const wchar_t *a,const wchar_t *b)

Parameters:
Type Name Direction Description
const wchar_t *a[IN]a
const wchar_t *b[IN]b

   findsubstr


Signature:
unsigned int strman::findsubstr(const wchar_t *a,const wchar_t *b)

Parameters:
Type Name Direction Description
const wchar_t *a[IN]a
const wchar_t *b[IN]b

   substrmatch


Signature:
bool strman::substrmatch(const wchar_t *searchpat,const wchar_t *text)

Parameters:
Type Name Direction Description
const wchar_t *searchpat[IN]searchpat
const wchar_t *text[IN]text

   matchpat


Signature:
bool strman::matchpat(wchar_t *a,wchar_t *b)

Parameters:
Type Name Direction Description
wchar_t *a[IN]a
wchar_t *b[IN]b

   matchpat_i


Signature:
bool strman::matchpat_i(wchar_t *a,wchar_t *b,unsigned int pos_a,unsigned int pos_b)

Parameters:
Type Name Direction Description
wchar_t *a[IN]a
wchar_t *b[IN]b
unsigned int pos_apos_a
unsigned int pos_bpos_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 wchar_t *str,size_t pos_in_str,const wchar_t *symbols)

Parameters:
Type Name Direction Description
const wchar_t *str[IN]a null-terminated string.
size_t pos_in_strindex within the string str.
const wchar_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 wchar_t *str,size_t pos_in_str,const wchar_t *symbols0,const wchar_t *symbols1)

Parameters:
Type Name Direction Description
const wchar_t *str[IN]a null-terminated string.
size_t pos_in_strindex within the string str.
const wchar_t *symbols0[IN]a null-terminated string.
const wchar_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 wchar_t *str,size_t pos_in_str,const wchar_t *symbols0,const wchar_t *symbols1,const wchar_t *symbols2)

Parameters:
Type Name Direction Description
const wchar_t *str[IN]a null-terminated string.
size_t pos_in_strindex within the string str.
const wchar_t *symbols0[IN]a null-terminated string.
const wchar_t *symbols1[IN]a null-terminated string.
const wchar_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 wchar_t *str,size_t pos_in_str,const wchar_t *symbols0,const wchar_t *symbols1,const wchar_t *symbols2,const wchar_t *symbols3)

Parameters:
Type Name Direction Description
const wchar_t *str[IN]a null-terminated string.
size_t pos_in_strindex within the string str.
const wchar_t *symbols0[IN]a null-terminated string.
const wchar_t *symbols1[IN]a null-terminated string.
const wchar_t *symbols2[IN]a null-terminated string.
const wchar_t *symbols3[IN]a null-terminated string.

Return value:
Returns true, if a match is found and false otherwise.


Copyright © 2017 - 2019 by Andreas Pollhammer