gatelib
2.1
|
Functions | |
wchar_t * | g::str::to_widestr (const char *src, wchar_t *dst=(wchar_t *) alloc_new) |
converts a byte gstr ( const char* ) to a wide one ( wchar_t* ). More... | |
char * | g::str::to_charstr (const wchar_t *src, char *dst=(char *) alloc_new) |
converts a wide gstr ( const wchar_t* ) to a wide one ( char* ) More... | |
template<class T > | |
size_t | g::str::get_len (const T *aString) |
Returns the string length. | |
template<class T > | |
size_t | g::str::str_copy (T *aDestP, const T *aSrcP, size_t aNumChars=infinite) |
Copies from aSrc to aDest up to a maximum of aNumChars characters (excluding terminator) More... | |
template<class T > | |
int | g::str::str_compare (const T *aS1, const T *aS2, bool aIsCaseSens=true, size_t aNumChars=infinite) |
Compares two strings. More... | |
template<class T > | |
bool | g::str::str_equal (const T *aS1, const T *aS2, bool aIsCaseSens=true, size_t aNumChars=infinite) |
Check two strings for equality. More... | |
template<class T > | |
size_t | g::str::str_search (const T *aS1, const T *aS2, bool aIsCaseSens=true, size_t aNumChars=infinite) |
Searches aS2 inside aS1. More... | |
template<class T > | |
size_t | g::str::str_replace (const T *aString, const T *aWhat, const T *aWith, T *aOutputBuffer, size_t aNumChars=infinite) |
Replace aWhat with aWith inside aInput, the result is stored into aOutputBuffer, whose capacity us aNumChars. More... | |
template<class T , class R , size_t S> | |
R | g::str::str_replace (const T *aInput, const T *aWhat, const T *aWith) |
Replace aWhat with aWith inside aInput and returns the result as a class string (a std::string , std::wstring , g::cont::g_str<T>) More... | |
|
inline |
Compares two strings.
aS1 | first string to be compared |
aS2 | second string to be compared |
aIsCaseSens | comparition to be case sensitive or not? |
aNumChars | num of chars to be compared. |
T | a character type(char,wchar_t) |
|
inline |
Copies from aSrc to aDest up to a maximum of aNumChars characters (excluding terminator)
Referenced by g::str::str_replace().
|
inline |
Check two strings for equality.
aS1 | first string to be compared |
aS2 | second string to be compared |
aIsCaseSens | comparition to be case sensitive or not? |
aNumChars | num of chars to be compared. |
T | a character type(char,wchar_t) |
|
inline |
Replace aWhat with aWith inside aInput, the result is stored into aOutputBuffer, whose capacity us aNumChars.
T | a character type(char,wchar_t) |
aString | input string (a char buffer) |
aWhat | string to be searched |
aWith | string replacing aWhat occurences |
aOutputBuffer | char buffer with a capacity of aNumChars + 1 (stores the terminator too) |
aNumChars | capacity of aOutputBuffer (excluding the terminator) |
|
inline |
Replace aWhat with aWith inside aInput and returns the result as a class string (a std::string , std::wstring , g::cont::g_str<T>)
T | char type (char,wchar_t) |
R | return type (a structured, not necessarly emplate type ) where the operator += ( const T* ) must be defined. |
S,size | in chars (excluding the terminator), therefore temp buffer has a capacity of S+1. |
aString | input string (a char buffer) |
aWhat | string to be searched |
aWith | string replacing aWhat occurences |
|
inline |
Searches aS2 inside aS1.
aS1 | first string to be compared |
aS2 | second string to be compared |
aIsCaseSens | comparition to be case sensitive or not? |
aNumChars | num of chars to be compared. |
T | a character type(char,wchar_t) |
Searches aS2 inside aS1 until an offset of aNumChars from aS1.
If the search succeeds the returns the offset, otherwise returns the size of aS1 or aNumChars, if it is < of size(aS1)
Referenced by g::str::str_replace().
|
inline |
converts a wide gstr ( const wchar_t* ) to a wide one ( char* )
converts a wide gstr ( const wchar_t* ) to an ANSI one ( char* ).
if len = 0 returns null.
if dst = alloc_new ( 0 ) then it allocates the needed chars.
if len = 0 returns null.
if dst = alloc_new ( 0 ) then it allocates the needed chars
|
inline |
converts a byte gstr ( const char* ) to a wide one ( wchar_t* ).
converts a byte gstr ( const char* ) to a wide one ( wchar_t* )
if len = 0 returns null
if dst = alloc_new ( 0 ) then it allocates the needed chars