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 mstr [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 )

About

This module provides basic functionality for strings (like copying, concatenation and comparison) with automated reallocation of larger memory blocks, if required.


Static Template Methods:
create
mstrs< char16_t > *mstr::create(mstrs< char16_t > **mstring,unsigned int length)
create_from_str (version 1)
mstrs< char16_t > *mstr::create_from_str(mstrs< char16_t > **mstring,const char16_t *c_str)
create_from_str (version 2)
mstrs< char16_t > *mstr::create_from_str(mstrs< char16_t > **mstring,const char16_t *c_str,unsigned int length)
destroy
void mstr::destroy(mstrs< char16_t > *mstring)
length
unsigned int mstr::length(mstrs< char16_t > *mstring)
buffer_length
unsigned int mstr::buffer_length(mstrs< char16_t > *mstring)
buffer_bytes
unsigned int mstr::buffer_bytes(mstrs< char16_t > *mstring)
used_memory
unsigned int mstr::used_memory(mstrs< char16_t > *mstring)
cpy
mstrs< char16_t > *mstr::cpy(mstrs< char16_t > *mstring_a,mstrs< char16_t > *mstring_b)
cat
mstrs< char16_t > *mstr::cat(mstrs< char16_t > *mstring_a,mstrs< char16_t > *mstring_b)
cmp
int mstr::cmp(mstrs< char16_t > *mstring_a,mstrs< char16_t > *mstring_b)
fit
mstrs< char16_t > *mstr::fit(mstrs< char16_t > *mstring)
reset
mstrs< char16_t > *mstr::reset(mstrs< char16_t > *mstring)
c_str
char16_t *mstr::c_str(mstrs< char16_t > *mstring)
copy_str
mstrs< char16_t > *mstr::copy_str(mstrs< char16_t > *mstring,const char16_t *c_str)
append_str
mstrs< char16_t > *mstr::append_str(mstrs< char16_t > *mstring,const char16_t *c_str)
compare_str
int mstr::compare_str(mstrs< char16_t > *mstring,const char16_t *c_str)
is_prefix (version 1)
bool mstr::is_prefix(mstrs< char16_t > *str,mstrs< char16_t > *prefix)
is_prefix (version 2)
bool mstr::is_prefix(const char16_t *c_str,mstrs< char16_t > *prefix)
is_prefix (version 3)
int mstr::is_prefix(const char16_t *c_str,mstrs< char16_t > **prefix)

Static Template Methods

   create


Returns a new empty string.

Signature:
mstrs< char16_t > *mstr::create(mstrs< char16_t > **mstring,unsigned int length)

Parameters:
Type Name Direction Description
mstrs< char16_t > **mstring[OUT]Address of a Pointer of type (mstrs< T > *).
unsigned int lengthThe initial length (in number of characters) of the memory block to store the string.

Return value:
A pointer to the new allocated mstrs structure.

   create_from_str (version 1)


Constructs a new mstrs structure.

Signature:
mstrs< char16_t > *mstr::create_from_str(mstrs< char16_t > **mstring,const char16_t *c_str)

Parameters:
Type Name Direction Description
mstrs< char16_t > **mstring[OUT]Address of a Pointer of type (mstrs< T > *).
const char16_t *c_str[IN]Pointer to a null-terminated string.

Return value:
A pointer to the new allocated mstrs structure.

   create_from_str (version 2)


Constructs a new mstrs structure.

Signature:
mstrs< char16_t > *mstr::create_from_str(mstrs< char16_t > **mstring,const char16_t *c_str,unsigned int length)

Parameters:
Type Name Direction Description
mstrs< char16_t > **mstring[OUT]Address of a Pointer of type (mstrs< T > *).
const char16_t *c_str[IN]Pointer to a null-terminated string.
unsigned int lengthThe initial length (in number of characters) of the memory block to store the string.

Return value:
A pointer to the new allocated mstrs structure.

   destroy


Frees all memory allocated for mstring.

Signature:
void mstr::destroy(mstrs< char16_t > *mstring)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring[IN]Pointer to a mstrs structure.

   length


Returnes the length (in number of characters) of the string stored in mstring.

Signature:
unsigned int mstr::length(mstrs< char16_t > *mstring)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring[IN]Pointer to a mstrs structure.

Return value:
The length of the string.

   buffer_length


Returnes the length (in number of characters) of the memory block used to store the string in mstring.

The actual size of the memory block is one character larger than the returened value to account for the null-termination character.

Signature:
unsigned int mstr::buffer_length(mstrs< char16_t > *mstring)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring[IN]Pointer to a mstrs structure.

Return value:
The length of the memory block.

   buffer_bytes


Returnes the size in bytes of the memory block used to store the string in mstring.

Signature:
unsigned int mstr::buffer_bytes(mstrs< char16_t > *mstring)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring[IN]Pointer to a mstrs structure.

Return value:
The size of the memory block.

   used_memory


Returnes the total memory in bytes used by mstring.

Signature:
unsigned int mstr::used_memory(mstrs< char16_t > *mstring)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring[IN]Pointer to a mstrs structure.

Return value:
The size of the used memory.

   cpy


Copies the string from mstring_b to mstring_a.

Signature:
mstrs< char16_t > *mstr::cpy(mstrs< char16_t > *mstring_a,mstrs< char16_t > *mstring_b)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring_a[IN/OUT]Pointer to a mstrs structure.
mstrs< char16_t > *mstring_b[IN]Pointer to a mstrs structure.

Return value:
A pointer to mstring_a.

   cat


Appends the string from mstring_b to mstring_a.

Signature:
mstrs< char16_t > *mstr::cat(mstrs< char16_t > *mstring_a,mstrs< char16_t > *mstring_b)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring_a[IN/OUT]Pointer to a mstrs structure.
mstrs< char16_t > *mstring_b[IN]Pointer to a mstrs structure.

Return value:
A pointer to mstring_a.

   cmp


Compares mstring_b with mstring_a.

Signature:
int mstr::cmp(mstrs< char16_t > *mstring_a,mstrs< char16_t > *mstring_b)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring_a[IN]Pointer to a mstrs structure.
mstrs< char16_t > *mstring_b[IN]Pointer to a mstrs structure.

Return value:
Returnes 0 if both strings are equal and a value other than 0 otherwise.

   fit


Reduces the size of the allocated memory to fit the string stored in mstring.

Signature:
mstrs< char16_t > *mstr::fit(mstrs< char16_t > *mstring)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring[IN]Pointer to a mstrs structure.

Return value:
A pointer to mstring.

   reset


Resets the string stored in mstring to the empty string.

Signature:
mstrs< char16_t > *mstr::reset(mstrs< char16_t > *mstring)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring[IN]Pointer to a mstrs structure.

Return value:
A pointer to mstring.

   c_str


Returns a pointer to the null-terminated string stored in mstring.

Signature:
char16_t *mstr::c_str(mstrs< char16_t > *mstring)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring[IN]Pointer to a mstrs structure.

Return value:
A Pointer to the null-rerminated string.

   copy_str


Copies the null-terminated string c_str to mstring.

Signature:
mstrs< char16_t > *mstr::copy_str(mstrs< char16_t > *mstring,const char16_t *c_str)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring[IN]Pointer to a mstrs structure.
const char16_t *c_str[IN]Pointer to a null-terminated string.

Return value:
A pointer to mstring.

   append_str


Appends the null-terminated string c_str to mstring.

Signature:
mstrs< char16_t > *mstr::append_str(mstrs< char16_t > *mstring,const char16_t *c_str)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring[IN]Pointer to a mstrs structure.
const char16_t *c_str[IN]Pointer to a null-terminated string.

Return value:
A pointer to mstring.

   compare_str


Compares mstring with the null-terminated string c_str.

Signature:
int mstr::compare_str(mstrs< char16_t > *mstring,const char16_t *c_str)

Parameters:
Type Name Direction Description
mstrs< char16_t > *mstring[IN]Pointer to a mstrs structure.
const char16_t *c_str[IN]Pointer to a null-terminated string.

Return value:
Returnes 0 if both strings are equal and a value other than 0 otherwise.

   is_prefix (version 1)


Tests if prefix is prefix of str.

Signature:
bool mstr::is_prefix(mstrs< char16_t > *str,mstrs< char16_t > *prefix)

Parameters:
Type Name Direction Description
mstrs< char16_t > *str[IN]Pointer to a mstrs structure.
mstrs< char16_t > *prefix[IN]Pointer to a mstrs structure.

Return value:
Returns true if the strings matches and false otherwise.

   is_prefix (version 2)


Tests if prefix is prefix of str.

Signature:
bool mstr::is_prefix(const char16_t *c_str,mstrs< char16_t > *prefix)

Parameters:
Type Name Direction Description
const char16_t *c_str[IN]Pointer to a null-terminated string.
mstrs< char16_t > *prefix[IN]Pointer to a mstrs structure.

Return value:
Returns true if the strings matches and false otherwise.

   is_prefix (version 3)


Tests if one of the strings in prefix is prefix of str.

Signature:
int mstr::is_prefix(const char16_t *c_str,mstrs< char16_t > **prefix)

Parameters:
Type Name Direction Description
const char16_t *c_str[IN]Pointer to a null-terminated string.
mstrs< char16_t > **prefix[IN]Pointer to a null-terminated series of pointers to mstrs structures.

Return value:
Returns the index of the first string that matches. If no string in prefix is prefix of c_str, the function returns -1.


Copyright © 2017 - 2019 by Andreas Pollhammer