#include "CTBstring.hxx"
Collaboration diagram for CTBstring:
Public Methods | |
CTBstring () | |
CTBstring (const CTBstring &rhs) | |
CTBstring (CTBstring &rhs, bool b_grab) | |
CTBstring (const CTBstring &rhs, CTBint i_length) | |
CTBstring (const CTBstring &rhs, CTBint i_offset, CTBint i_length) | |
CTBstring (const char *c_rhs) | |
CTBstring (const char *c_rhs, CTBint i_length) | |
~CTBstring () | |
const char * | Data () const |
CTBint | Length () const |
bool | IsNull () const |
bool | IsEmpty () const |
void | Copy (const CTBstring &rhs) |
void | Copy (const char *c_rhs) |
void | Copy (char c_rhs) |
void | Append (const CTBstring &rhs) |
void | Append (const char *c_rhs) |
void | Append (const char *c_rhs, CTBint i_length) |
void | Append (char c_rhs) |
void | Clear () |
int | Compare (const CTBstring &rhs) const |
int | Compare (const char *c_rhs) const |
int | CompareCaseBlind (const CTBstring &rhs) const |
int | CompareCaseBlind (const char *c_rhs) const |
bool | IsWhite () const |
bool | IsUpperCase () const |
bool | IsLowerCase () const |
void | TrimWhite () |
void | CollapseWhite () |
void | ToUpperCase () |
void | ToLowerCase () |
bool | Get (long &i_val, int i_base=0) const |
bool | Get (unsigned long &i_val, int i_base=0) const |
bool | Get (int &i_val, int i_base=0) const |
bool | Get (unsigned int &i_val, int i_base=0) const |
bool | Get (double &d_val) const |
bool | Get (float &f_val) const |
CTBint | FindCharacter (char c, CTBint i_offset=0) const |
CTBint | FindCharacter (const char *c_set, CTBint i_offset=0) const |
CTBint | FindCharacter (const CTBstring &set, CTBint i_offset=0) const |
CTBstring | Escape () const |
CTBstring | Unescape () const |
bool | GetLine (istream &is) |
void | Grab (CTBstring &rhs) |
void | Dump (int i_indent=0, ostream &os=cout, const char *p_text=0) const |
CTBstring & | operator= (const CTBstring &rhs) |
CTBstring & | operator= (const char *c_rhs) |
CTBstring & | operator= (char c_rhs) |
CTBstring & | operator+= (const CTBstring &rhs) |
CTBstring & | operator+= (const char *c_rhs) |
CTBstring & | operator+= (char c_rhs) |
CTBstring & | operator<< (const CTBstring &rhs) |
CTBstring & | operator<< (const char *c_rhs) |
CTBstring & | operator<< (char c_rhs) |
char | operator[] (CTBint i_ind) const |
CTBstring | operator() (CTBint i_length) const |
CTBstring | operator() (CTBint i_offset, CTBint i_length) const |
operator const char * () const | |
Static Public Methods | |
const CTBstring & | NullString () |
const CTBstring & | EmptyString () |
Private Methods | |
void | Unshare () |
void | EnsureUnsharedCapacity (CTBint i_capacity) |
void | NewString (const char *c_str, CTBint i_len) |
void | NewString (const char *c_str1, CTBint i_len1, const char *c_str2, CTBint i_len2) |
void | AppendData (const char *c_str, CTBint i_len) |
void | Terminate () |
CTBint | FindCharacter (const char *c_set, CTBint i_len, CTBint i_offset) const |
Private Attributes | |
CTBsharedBuffer< char > | m_sbuf |
CTBint | mi_offset |
CTBint | mi_length |
Friends | |
CTBstring | operator+ (const CTBstring &lhs, const CTBstring &rhs) |
CTBstring | operator+ (const CTBstring &lhs, const char *c_rhs) |
CTBstring | operator+ (const char *c_lhs, const CTBstring &rhs) |
bool | operator== (const CTBstring &lhs, const CTBstring &rhs) |
bool | operator< (const CTBstring &lhs, const CTBstring &rhs) |
bool | operator== (const CTBstring &lhs, const char *c_rhs) |
bool | operator< (const CTBstring &lhs, const char *c_rhs) |
bool | operator== (const char *c_lhs, const CTBstring &rhs) |
bool | operator< (const char *c_lhs, const CTBstring &rhs) |
ostream & | operator<< (ostream &os, const CTBstring &rhs) |
Definition at line 19 of file CTBstring.hxx.
|
Construct empty.
Definition at line 17 of file CTBstring.icc. Referenced by operator()().
|
|
Copy constructor.
Definition at line 62 of file CTBstring.cxx. |
|
For a pro's and con's using grabs with CTBstring see Definition at line 28 of file CTBstring.icc. |
|
Construct from substring.
Definition at line 73 of file CTBstring.cxx. |
|
Construct from substring.
Definition at line 84 of file CTBstring.cxx. |
|
Construct from char*.
Definition at line 99 of file CTBstring.cxx. |
|
Construct from char* substring.
Definition at line 111 of file CTBstring.cxx. |
|
Destructor.
Definition at line 40 of file CTBstring.icc. |
|
Returns a pointer to char.
Definition at line 46 of file CTBstring.icc. Referenced by Append(), AppendData(), Compare(), CompareCaseBlind(), Escape(), FindCharacter(), Get(), CTBxmlIStream::GetDataStream(), IsLowerCase(), IsUpperCase(), IsWhite(), CTBxmlOStream::PutEscapedString(), Terminate(), Unescape(), Unshare(), operator const char *(), operator+(), operator<<(), and operator[]().
|
|
Returns length of string.
Definition at line 54 of file CTBstring.icc. Referenced by Append(), CTBstring(), CollapseWhite(), Compare(), CompareCaseBlind(), CTBxmlIStream::ConvertEntityRef(), Escape(), FindCharacter(), CTBline::FromStream(), CTBattrList::FromXStream(), CTBxmlIStream::GetDataStream(), CTBxmlOStream::PutEscapedString(), CTBxmlOStream::PutTaggedValue(), Terminate(), ToLowerCase(), ToUpperCase(), Unescape(), Unshare(), operator+(), operator<<(), and operator[]().
|
|
Returns
Definition at line 62 of file CTBstring.icc. |
|
Returns
Definition at line 70 of file CTBstring.icc. |
|
Copy string.
Definition at line 123 of file CTBstring.cxx. Referenced by operator=().
|
|
Copy char*.
Definition at line 136 of file CTBstring.cxx. |
|
Copy char.
Definition at line 146 of file CTBstring.cxx. |
|
Append string.
Definition at line 159 of file CTBstring.cxx. Referenced by operator+=(), and operator<<().
|
|
Append char*.
Definition at line 169 of file CTBstring.cxx. |
|
Append char*.
Definition at line 179 of file CTBstring.cxx. |
|
Append char.
Definition at line 189 of file CTBstring.cxx. |
|
Reset the string to an empty string.
Definition at line 78 of file CTBstring.icc. Referenced by CTBxmlLexerToken::Clear(), CTBxmlToken::Clear(), CTBxmlIStream::Close(), CTBxmlIStream::Get(), and CTBxmlIStream::GetDataStream().
|
|
Compare to string. Returns an integer less than, equal to, or greater than zero if this is found, respectively, to be less than, to match, or be greater than rhs. Null strings are equivalent to empty strings in this comparison. Definition at line 219 of file CTBstring.cxx. Referenced by operator<(), and operator==().
|
|
Compare to char*. Returns an integer less than, equal to, or greater than zero if this is found, respectively, to be less than, to match, or be greater than c_rhs. Null strings are equivalent to empty strings in this comparison. Definition at line 239 of file CTBstring.cxx. |
|
Case blind comparison with a string. Returns an integer less than, equal to, or greater than zero if this is found, respectively, to be less than, to match, or be greater than rhs. Null strings are equivalent to empty strings in this comparison. Definition at line 259 of file CTBstring.cxx. |
|
Case blind comparison with a char*. Returns an integer less than, equal to, or greater than zero if this is found, respectively, to be less than, to match, or be greater than c_rhs. Null strings are equivalent to empty strings in this comparison. Definition at line 282 of file CTBstring.cxx. |
|
Returns
White space characters are (in the "C" locale): space, form-feed('\f'), newline('\n'), carriage return('\r'), horizontal tab('\t'), and vertical tab ('\v'). Note, that Definition at line 306 of file CTBstring.cxx. |
|
Returns
Note, that Definition at line 322 of file CTBstring.cxx. |
|
Returns
Note, that Definition at line 341 of file CTBstring.cxx. |
|
Trims all white space from the head and tail of the string.
For the set of white space characters see Definition at line 360 of file CTBstring.cxx. Referenced by CTBline::SetupString().
|
|
Replace all sequences of white space by a single blank.
Note, that leading and trailing white space is not removed but also just replaced by a single blank. To remove it use Definition at line 384 of file CTBstring.cxx. |
|
Convert all characters to upper case.
Definition at line 412 of file CTBstring.cxx. |
|
Convert all characters to lower case.
Definition at line 427 of file CTBstring.cxx. Referenced by CTBline::SetupString().
|
|
Convert string to
Definition at line 442 of file CTBstring.cxx. |
|
Convert string to
Definition at line 453 of file CTBstring.cxx. |
|
Convert string to
Definition at line 464 of file CTBstring.cxx. |
|
Convert string to
Definition at line 475 of file CTBstring.cxx. |
|
Convert string to
Definition at line 486 of file CTBstring.cxx. |
|
Convert string to
Definition at line 497 of file CTBstring.cxx. |
|
Find first occurence of character c. Scans the string starting at offset i_offset for the character c. The method returns the index of the first match. If no match found, the length of this is returned. If i_offset is < 0 it is set to 0 and the full string is processed. If i_offset is >= Length(), a return value of Length() is returned. Definition at line 96 of file CTBstring.icc. Referenced by Escape(), FindCharacter(), and Unescape().
|
|
Find first occurence of a character from the set given by c_set. Scans the string starting at offset i_offset for a character in the set given by c_set. The method returns the index of the first match. If no match found, the length of this is returned. If i_offset is < 0 it is set to 0 and the full string is processed. If i_offset is >= Length(), a return value of Length() is returned. Definition at line 515 of file CTBstring.cxx. |
|
Find first occurence of a character in set set. Scans the string starting at offset i_offset for a character in the set given by set. The method returns the index of the first match. If no match found, the length of this is returned. If i_offset is < 0 it is set to 0 and the full string is processed. If i_offset is >= Length(), a return value of Length() is returned. Definition at line 111 of file CTBstring.icc. |
|
Returns a string with all non-blank white space characters escaped.
Definition at line 523 of file CTBstring.cxx. Referenced by CTBxmlLexerToken::ToStream(), and CTBxmlToken::ToStream().
|
|
Returns a string with all 'x' type escape sequences translated. \ Definition at line 565 of file CTBstring.cxx. |
|
Get a line from
Definition at line 625 of file CTBstring.cxx. Referenced by CTBline::FromStream().
|
|
Grab resources.
The resources allocated for rhs will be transfered to Definition at line 128 of file CTBstring.icc. Referenced by CTBxmlToken::Grab().
|
|
Dump.
Definition at line 645 of file CTBstring.cxx. Referenced by CTBxmlLexerToken::Dump(), CTBxmlIStream::Dump(), and CTBxmlToken::Dump().
|
|
Assign string (see Copy(const CTBstring&) ).
Definition at line 145 of file CTBstring.icc. |
|
Assign char* (see Copy(const char*) ).
Definition at line 153 of file CTBstring.icc. |
|
Assign char (see Copy(char) ).
Definition at line 161 of file CTBstring.icc. |
|
Append string (see Append(const CTBstring&) ).
Definition at line 174 of file CTBstring.icc. |
|
Append char* (see Append(const char*) ).
Definition at line 182 of file CTBstring.icc. |
|
Append char (see Append(char) ).
Definition at line 190 of file CTBstring.icc. |
|
Append string (see Append(const CTBstring&) ).
Definition at line 203 of file CTBstring.icc. |
|
Append char* (see Append(const char*) ).
Definition at line 211 of file CTBstring.icc. |
|
Append char (see Append(char) ).
Definition at line 219 of file CTBstring.icc. |
|
Returns character at position i_ind.
A value of 0 is returned if i_ind is < 0 or > Definition at line 664 of file CTBstring.cxx. |
|
Create substring.
Definition at line 232 of file CTBstring.icc. |
|
Create substring.
Definition at line 239 of file CTBstring.icc. |
|
Convert to char*.
The returned pointer is valid as long as the Definition at line 681 of file CTBstring.cxx. |
|
Returns reference of a Null string.
Definition at line 766 of file CTBstring.cxx. Referenced by CTBattrList::operator[]().
|
|
Returns reference of an Empty string.
Definition at line 775 of file CTBstring.cxx. Referenced by CTBxmlIStream::GetDataStream(), and CTBxmlIStream::GetTaggedValue().
|
|
Make sure the string isn't shared and isn't a substring.
Definition at line 784 of file CTBstring.cxx. Referenced by CollapseWhite(), ToLowerCase(), and ToUpperCase().
|
|
Get enough writable buffer. This method makes sure that the buffer is unshared and has space for i_capacity characters plus a terminating zero. Note, that it assumes that the whole buffer is written afterwards, it will not preserve the context of a substring !! Definition at line 804 of file CTBstring.cxx. Referenced by AppendData(), and NewString().
|
|
New string from 1 source. If c_str is null the CTBstring object will be reset to a null string. Otherwise a string with i_len characters is created. Note that this method expects that there are no null characters in c_str[0] ... c_str[i_len-1] . Definition at line 834 of file CTBstring.cxx. Referenced by CTBstring(), Copy(), Terminate(), Unshare(), and operator+().
|
|
New string from 2 sources. If c_str1 and c_str2 are null the CTBstring object will be reset to a null string. Otherwise the first i_len1 characters of the C string c_str1 and the first i_len2 characters of the C string c_str2 are concatinated. Note that this method exprects that there are no null characters in c_str1[0] ... c_str1[i_len1-1] and c_str2[0] ... c_str2[i_len2-1]. Definition at line 864 of file CTBstring.cxx. |
|
Internal append engine.
Definition at line 891 of file CTBstring.cxx. Referenced by Append().
|
|
Terminate a substring.
Definition at line 925 of file CTBstring.cxx. Referenced by operator const char *().
|
|
Find first occurence of a character in set c_set with length i_len. Scans the string starting at offset i_offset for a character in the set c_set[0],...c_set[i_len-1]. The method returns the index of the first match. If no match found, the length of this is returned. If i_offset is < 0 it is set to 0 and the full string is processed. If i_offset is >= Length(), a return value of Length() is returned. Definition at line 951 of file CTBstring.cxx. |
|
Concatinate string + string.
Definition at line 711 of file CTBstring.cxx. |
|
Concatinate string + char*.
Definition at line 726 of file CTBstring.cxx. |
|
Concatinate char* + string.
Definition at line 741 of file CTBstring.cxx. |
|
Comparison string - string.
Definition at line 255 of file CTBstring.icc. |
|
Comparison string - string.
Definition at line 265 of file CTBstring.icc. |
|
Comparison string - char*.
Definition at line 275 of file CTBstring.icc. |
|
Comparison string - char*.
Definition at line 285 of file CTBstring.icc. |
|
Comparison char* - string.
Definition at line 295 of file CTBstring.icc. |
|
Comparison char* - string.
Definition at line 305 of file CTBstring.icc. |
|
ostream insertion operator.
Definition at line 756 of file CTBstring.cxx. |
|
shared char buffer.
Definition at line 147 of file CTBstring.hxx. |
|
substring offset.
Definition at line 148 of file CTBstring.hxx. |
|
length.
Definition at line 149 of file CTBstring.hxx. |