ZFFramework
 
Loading...
Searching...
No Matches
ZFCoreStringUtil.h File Reference

string utilities for ZFFramework More...

#include "ZFCoreArray.h"
#include "ZFCoreStringConvert.h"

Go to the source code of this file.

Macros

#define zfstringSwitch(v, c0, ...)
 util to switch-case on string
 

Functions

zfcharzfsCopy (const zfchar *src)
 util method to copy the contents of src, return null if src null, or empty string if src is empty string
 
zfcharzfsCopy (const zfchar *src, zfindex size)
 util method to copy the contents of src, return null if src null, or empty string if src is empty string
 
zfcharzfsChange (zfchar *&dst, const zfchar *src)
 util method to free old string then copy and change to new string, free and set dst to null if src is null, otherwise, realloc and copy contents to dst
 
zfcharzfsChange (zfchar *&dst, const zfchar *src, zfindex size)
 util method to free old string then copy and change to new string, free and set dst to null if src is null, otherwise, realloc and copy contents to dst
 
zfcharzfsAppend (zfchar *&old, const zfchar *append)
 util method to append string to existing string buffer, realloc if need
 
zfcharzfsAppend (zfchar *&old, const zfchar *append, zfindex size)
 util method to append string to existing string buffer, realloc if need
 
zfindex zfsCheckMatch (const zfchar **tokens, zfindex tokenCount, const zfchar *toCompare, zfindex toCompareLength=((zfindex) -1))
 check whether the toCompare matches the tokens, return the index in tokens or zfindexMax() if not matched
 
zfbool zfstringIsEqual (const zfchar *s1, const zfchar *s2)
 util to compare two c strings, while null is regarded as equal to empty string
 
zfbool zfstringIsEqual (const zfchar *s1, zfindex s1Len, const zfchar *s2, zfindex s2Len)
 util to compare two c strings, while null is regarded as equal to empty string
 
zfbool zfstringIsEmpty (const zfchar *s)
 util to check whether string is empty (null or empty string)
 
zfbool zfstringIsEmpty (const zfchar *s, zfindex len)
 util to check whether string is empty (null or empty string)
 
zfindex zfstringFind (const zfchar *src, zfindex srcLen, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFind (const zfchar *src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFind (const zfstring &src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindReversely (const zfchar *src, zfindex srcLen, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindReversely (const zfchar *src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindReversely (const zfstring &src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindCaseInsensitive (const zfchar *src, zfindex srcLen, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindCaseInsensitive (const zfchar *src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindCaseInsensitive (const zfstring &src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindCaseInsensitiveReversely (const zfchar *src, zfindex srcLen, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindCaseInsensitiveReversely (const zfchar *src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindCaseInsensitiveReversely (const zfstring &src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindFirstOf (const zfchar *src, zfindex srcLen, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindFirstOf (const zfchar *src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindFirstOf (const zfstring &src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindFirstNotOf (const zfchar *src, zfindex srcLen, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindFirstNotOf (const zfchar *src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindFirstNotOf (const zfstring &src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindLastOf (const zfchar *src, zfindex srcLen, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindLastOf (const zfchar *src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindLastOf (const zfstring &src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindLastNotOf (const zfchar *src, zfindex srcLen, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindLastNotOf (const zfchar *src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfindex zfstringFindLastNotOf (const zfstring &src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfstring zfstringReplace (const zfchar *src, const zfchar *replaceFrom, const zfchar *replaceTo, zfindex maxCount=((zfindex) -1), zfindex *replacedCount=zft_zfnull)
 replace string
 
zfstring zfstringReplaceReversely (const zfchar *src, const zfchar *replaceFrom, const zfchar *replaceTo, zfindex maxCount=((zfindex) -1), zfindex *replacedCount=zft_zfnull)
 replace string
 
zfbool zfstringBeginWith (const zfchar *src, zfindex srcLen, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfbool zfstringBeginWith (const zfchar *src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfbool zfstringBeginWith (const zfstring &src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfbool zfstringEndWith (const zfchar *src, zfindex srcLen, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfbool zfstringEndWith (const zfchar *src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
zfbool zfstringEndWith (const zfstring &src, const zfchar *find, zfindex findLen=((zfindex) -1))
 find string
 
void zfstringSplitT (ZFCoreArray< zfstring > &ret, const zfchar *src, const zfchar *separator, zfbool keepEmpty=_ZFT_t_zffalse)
 split string
 
ZFCoreArray< zfstringzfstringSplit (const zfchar *src, const zfchar *separator, zfbool keepEmpty=_ZFT_t_zffalse)
 split string
 
void zfstringSplitIndexT (ZFCoreArray< ZFIndexRange > &ret, const zfchar *src, const zfchar *separator, zfbool keepEmpty=_ZFT_t_zffalse)
 split string
 
ZFCoreArray< ZFIndexRangezfstringSplitIndex (const zfchar *src, const zfchar *separator, zfbool keepEmpty=_ZFT_t_zffalse)
 split string
 
void zfstringToLowerT (zfstring &ret)
 to lower case
 
zfstring zfstringToLower (const zfchar *src, zfindex srcLen=((zfindex) -1))
 to lower case
 
void zfstringToUpperT (zfstring &ret)
 to upper case
 
zfstring zfstringToUpper (const zfchar *src, zfindex srcLen=((zfindex) -1))
 to upper case
 
void zfstringRepeatT (zfstring &ret, const zfchar *token, zfindex count)
 repeat string
 
zfstring zfstringRepeat (const zfchar *token, zfindex count)
 repeat string
 

Detailed Description

string utilities for ZFFramework

Macro Definition Documentation

◆ zfstringSwitch

#define zfstringSwitch ( v,
c0,
... )

util to switch-case on string

, "111"
, "222"
)) {
case 0:
ZFLog("case 111");
break;
case 1:
ZFLog("case 222");
break;
default:
ZFLog("default");
break;
}
#define zfstringSwitch(v, c0,...)
util to switch-case on string
Definition ZFCoreStringUtil.h:582
#define ZFLog(...)
thread-safe log utility
Definition ZFLog.h:77