The FastString class is very successful, 30% faster than String, more than 3 times the small data processing, provides a rich string processing method.
Mainly used for applications with higher performance requirements, most of which are intervals of data processing, such as server protocol processing, email protocol processing, and mail resolution processing.
/ ** * @class FastString * * @brief This class provides a wrapper facade for C strings. * * This class uses an included engine to allocate memory, * that stored one line string buffer in chars arrary and bigger * string in malloc buffer . * NOTE:. if an instance of this class is constructed from or * assigned an empty string (with first element of '/ 0'), then it * is not allocated new space Instead, its internal * representation is set equal to a . global empty string * CAUTION: in cases when FastString is constructed from a * provided buffer with the release parameter set to 0, * FastString is not guaranteed to be '/ 0' terminated * * @author Naven * /.
Template
Private: void init (); void allocate (const size_t size, int realock = 0);
public: FastString_Base
void set (const CHAR * str, size_t len); FastString_Base
SIZE_T longth () const; size_t capacity () const; limited char * c_str () const; char * rep () const; // char Operator [] (size_t i) const; char charat (const size_t) i) const; operator CHAR * () const; operator const CHAR * () const; operator void * () const; operator const void * () const; FastString_Base
int equals (const FastString_Base
FastString_Base
int indexOf (CHAR target [], size_t targetCount, size_t fromIndex, const int ignorecase = 0); int indexOf (CHAR target [], size_t fromIndex = 0); int indexOfIgnoreCase (CHAR target [], size_t targetCount, size_t fromIndex); int indexOfIgnoreCase (CHAR target [], size_t fromIndex = 0); int lastIndexOf (CHAR target [], size_t targetCount, size_t fromIndex, const int ignorecase = 0); int lastIndexOf (CHAR target [], size_t fromIndex = 0); int LastIndexofignorecase (char target [], size_t margetcount, size_t fromNDEX); int LastIndexofignorecase (char target [], size_t fromNDEX = 0);
Public: Static Char * Removechars (Char * S, Const Char * Chrs); Static Char * Replacechars (Char * S, Const Char * Chrs, Const Char CHR); Static Char * RTRIMCHARS (Char * S, Const Char * CHRS) Static char * LTRIMCHARS (Char * S, Const Char * Chrs); Static Char * Trimchars (CHAR * S, Const Char * Chrs); Static Char * RTRIM (Char * S); Static Char * Ltrim (Char * S) Static char * TRIM (Char * S); Static Char * NextLine (Char * SBUF, Const Int Size, Char ** PPTR, Char ** PPCHR, Char * CHR); Static Size_t extractvalueName (const char * str, const char * substr, const CHAR * div1, const CHAR * div2, CHAR * buf, const size_t size, const CHAR * vdiv, const int count = 1); static size_t extractIntegerByName (const CHAR * str, const CHAR * substr, long * value Const long defval = 0); static size_t extractValueby Name (const CHAR * str, const CHAR * substr, CHAR * value, const size_t size, const int count = 1); static size_t extractValueByIndex (const CHAR * pstr, const size_t len, CHAR * value, const size_t valsize, const CHAR tag, const int index); static int findIndexOf (CHAR source [], size_t sourceCount, CHAR target [], size_t targetCount, size_t fromIndex = 0, const int ignorecase = 0); static int findIndexOf (CHAR source [], CHAR target [], Size_t fromNDEX = 0);
static int findIndexOfIgnoreCase (CHAR source [], size_t sourceCount, CHAR target [], size_t targetCount, size_t fromIndex = 0); static int findIndexOfIgnoreCase (CHAR source [], CHAR target [], size_t fromIndex = 0); static int findLastIndexOf ( CHAR source [], size_t sourceCount, CHAR target [], size_t targetCount, size_t fromIndex = 0, const int ignorecase = 0); static int findLastIndexOf (CHAR source [], CHAR target [], size_t fromIndex = 0); static int findLastIndexOfIgnoreCase (CHAR source [], size_t sourceCount, CHAR target [], size_t targetCount, size_t fromIndex = 0); static int findLastIndexOfIgnoreCase (CHAR source [], CHAR target [], size_t fromIndex = 0);}; typ EdEf class faststring_base
TypedEf class fastaray_base
Typedef class fastaRray_iterator