|
TRF Language Model
|
a dynamic string class More...
#include <wb-string.h>
Public Member Functions | |
| String (int p_nLen=cn_default_str_len) | |
| store the top pointer. used in More... | |
| String (const char *p_str) | |
| String (const char *p_str, int nLen) | |
| String (char c) | |
| String (const String &p_str) | |
| ~String () | |
| char * | Reset (int nLen) |
| Reset the string leng. More... | |
| char * | GetBuffer () const |
| get buffer More... | |
| char * | End () const |
| get the pointer to the last position More... | |
| int | GetSize () const |
| get buffer size More... | |
| int | GetLength () const |
| get string length More... | |
| void | Clean () |
| set the string = "", but donot release the buffer More... | |
| const char * | Format (const char *p_pMessage,...) |
| format print to string More... | |
| void | operator= (const String &p_str) |
| operator = More... | |
| void | operator= (const char *pStr) |
| operator = More... | |
| operator char * () const | |
| operator (char*) More... | |
| char & | operator[] (int i) const |
| operator [] More... | |
| String | operator+= (const String &str) |
| operator += More... | |
| String | operator+= (const char *p) |
| operator += More... | |
| char * | Toupper () |
| to upper More... | |
| char * | Tolower () |
| to lower More... | |
| void | DeleteSub (int nLocal, int nLen) |
| delete a sub-string More... | |
| int | Find (const char *sub) |
| Find. More... | |
| String | Replace (const char *src, const char *rpl) |
| replace More... | |
| char * | TokBegin (const char *p) |
| split begin More... | |
| char * | TokSub (const char *p) |
| split next More... | |
| void | Split (Array< String > &aStrs, const char *delimiter) |
| split to string array. Using strtok(). More... | |
| String | FileName () |
| if the string is a path, this function return the file name. More... | |
| bool | operator> (const String &p_str) |
| compare function More... | |
| bool | operator< (const String &p_str) |
| bool | operator>= (const String &p_str) |
| bool | operator<= (const String &p_str) |
| bool | operator== (const String &p_str) |
| bool | operator!= (const String &p_str) |
| bool | operator> (const char *p) |
| compare function More... | |
| bool | operator< (const char *p) |
| bool | operator>= (const char *p) |
| bool | operator<= (const char *p) |
| bool | operator== (const char *p) |
| bool | operator!= (const char *p) |
Friends | |
| String | operator+ (const String &str, const char *p) |
| String | operator+ (const char *p, const String &str) |
| String | operator+ (const String &str1, const String &str2) |
a dynamic string class
A lot of function for string operation, including:
Definition at line 53 of file wb-string.h.
| wb::String::String | ( | int | p_nLen = cn_default_str_len | ) |
store the top pointer. used in
Definition at line 22 of file wb-string.cpp.
| wb::String::String | ( | const char * | p_str | ) |
Definition at line 27 of file wb-string.cpp.
| wb::String::String | ( | const char * | p_str, |
| int | nLen | ||
| ) |
Definition at line 33 of file wb-string.cpp.
| wb::String::String | ( | char | c | ) |
Definition at line 40 of file wb-string.cpp.
| wb::String::String | ( | const String & | p_str | ) |
Definition at line 46 of file wb-string.cpp.
| wb::String::~String | ( | ) |
Definition at line 51 of file wb-string.cpp.
|
inline |
set the string = "", but donot release the buffer
Definition at line 82 of file wb-string.h.
| void wb::String::DeleteSub | ( | int | nLocal, |
| int | nLen | ||
| ) |
delete a sub-string
Definition at line 95 of file wb-string.cpp.
|
inline |
get the pointer to the last position
Definition at line 76 of file wb-string.h.
| String wb::String::FileName | ( | ) |
if the string is a path, this function return the file name.
Definition at line 162 of file wb-string.cpp.
| int wb::String::Find | ( | const char * | sub | ) |
Find.
Definition at line 100 of file wb-string.cpp.
| const char * wb::String::Format | ( | const char * | p_pMessage, |
| ... | |||
| ) |
format print to string
Definition at line 69 of file wb-string.cpp.
|
inline |
get buffer
Definition at line 74 of file wb-string.h.
|
inline |
get string length
Definition at line 80 of file wb-string.h.
|
inline |
get buffer size
Definition at line 78 of file wb-string.h.
|
inline |
operator (char*)
Definition at line 90 of file wb-string.h.
|
inline |
Definition at line 100 of file wb-string.h.
|
inline |
Definition at line 111 of file wb-string.h.
operator +=
Definition at line 103 of file wb-string.h.
|
inline |
operator +=
Definition at line 114 of file wb-string.h.
|
inline |
Definition at line 96 of file wb-string.h.
|
inline |
Definition at line 107 of file wb-string.h.
|
inline |
Definition at line 98 of file wb-string.h.
|
inline |
Definition at line 109 of file wb-string.h.
| void wb::String::operator= | ( | const String & | p_str | ) |
operator =
Definition at line 83 of file wb-string.cpp.
| void wb::String::operator= | ( | const char * | pStr | ) |
operator =
Definition at line 89 of file wb-string.cpp.
|
inline |
Definition at line 99 of file wb-string.h.
|
inline |
Definition at line 110 of file wb-string.h.
|
inline |
compare function
Definition at line 95 of file wb-string.h.
|
inline |
compare function
Definition at line 106 of file wb-string.h.
|
inline |
Definition at line 97 of file wb-string.h.
|
inline |
Definition at line 108 of file wb-string.h.
|
inline |
operator []
Definition at line 92 of file wb-string.h.
| String wb::String::Replace | ( | const char * | src, |
| const char * | rpl | ||
| ) |
replace
Definition at line 108 of file wb-string.cpp.
| char * wb::String::Reset | ( | int | nLen | ) |
Reset the string leng.
Definition at line 56 of file wb-string.cpp.
split to string array. Using strtok().
Definition at line 149 of file wb-string.cpp.
|
inline |
split begin
Definition at line 118 of file wb-string.cpp.
|
inline |
split next
Definition at line 123 of file wb-string.cpp.
| char * wb::String::Tolower | ( | ) |
to lower
Definition at line 177 of file wb-string.cpp.
| char * wb::String::Toupper | ( | ) |
to upper
Definition at line 170 of file wb-string.cpp.
Definition at line 116 of file wb-string.h.
Definition at line 119 of file wb-string.h.
Definition at line 122 of file wb-string.h.