#include <TString.hh>
Public Methods | |
TString () | |
Constructs a string of length zero. | |
TString (const char *cs) | |
Constructs a string from the null terminated string cs. | |
TString (const char *cs, int n) | |
Constructs a string from the string cs of length n. | |
TString (const TString &str) | |
Constructs a string from str. | |
TString (char c) | |
Constructs a string containing the single character c. | |
TString (char c, int n) | |
Constructs a string containing the character c repeated n times. | |
~TString () | |
Destructor. | |
operator const char * () const | |
Return internal data as a null terminated character string. | |
operator int () const | |
Convert the string to an integer. | |
operator unsigned int () const | |
Convert the string to an unsigned integer. | |
TString & | operator= (const char *cs) |
Copy the null terminated string cs. | |
TString & | operator= (const TString &str) |
Copy the data of string str. | |
bool | operator== (const TString &str) const |
Compare string for equality with other TString object. | |
bool | operator== (const char *cs) const |
Compare string for equality with character string. | |
bool | operator!= (const TString &str) |
Compares two string objects for non-equality. | |
TString & | operator+= (const char *cs) |
Append cs to string. | |
TString & | operator+= (const TString &str) |
Append str to string. | |
TString & | operator+= (char c) |
Append the character c to string. | |
TString | operator+ (const char *cs) |
Append two strings together creating a third. | |
TString | operator+ (const TString &str) |
Append two strings together creating a third. | |
char | operator[] (int i) const |
Index operator. | |
TString & | Append (char c) |
Append the character c. | |
TString & | Append (char c, int n) |
Append n copies of the character c. | |
TString & | Append (const char *cs) |
Append a copy of the null terminated string cs. | |
TString & | Append (const char *cs, int n) |
Append a copy of the first n bytes of cs. | |
TString & | Append (const TString &str) |
Append a copy of str to string. | |
TString | BaseName () const |
Return a string containing the basename of the string. | |
TString | DirName () const |
Return a string containing the dirname of the string. | |
const char * | Data () const |
Return the data of ths string as a null terminated character string. | |
TString & | Clear () |
Clear string. | |
bool | Empty () const |
Check if the string is empty. | |
TString & | Format (const char *fmt,...) |
Format a string as printf does. | |
TString & | Insert (int pos, char c) |
Insert the character c at position pos. | |
TString & | Insert (int pos, char c, int n) |
Insert n copies of the character c at position pos. | |
TString & | Insert (int pos, const char *cs) |
Insert a copy of the null terminated string cs at position pos. | |
TString & | Insert (int pos, const char *cs, int n) |
Insert a copy of the first n bytes of cs at position pos. | |
TString & | Insert (int pos, const TString &str) |
Insert a copy of str at position pos. | |
unsigned int | Hash () const |
Calculate hash value of string. | |
bool | IsAscii () const |
Check is the string conists of ASCII characters only. | |
bool | IsDigits () const |
Check if the string conists of decimal digits only. | |
bool | IsXDigits () const |
Check if the string conists of hexa decimal digits only. | |
int | Length () const |
Returns the length of the string. | |
int | Integer () const |
Convert the string to an integer. | |
TString & | Lower () |
Convert string to lowercase letters only. | |
TString & | Prepend (char c) |
Prepend the character c. | |
TString & | Prepend (char c, int n) |
Prepend n copies of the character c. | |
TString & | Prepend (const char *cs) |
Prepend a copy of the null terminated string cs. | |
TString & | Prepend (const char *cs, int n) |
Prepend a copy of the first n bytes of cs. | |
TString & | Prepend (const TString &str) |
Prepend a copy of str. | |
void | Print (bool newline=true) const |
Print string to stdout. | |
TString & | Trim () |
Trim whitespace from beginning and end of string. | |
TString & | TrimLeft () |
Trim whitespace from beginning of string. | |
TString & | TrimRight () |
Trim whitespace from end of string. | |
TString & | Truncate (int pos) |
Truncate string at the specified position. | |
unsigned int | UnsignedInteger () const |
Convert the string to an unsigned integer. | |
TString & | Upper () |
Convert string to uppercase letters only. | |
Static Public Methods | |
int | Length (const char *cs) |
Faster than strlen() for short strings and according to my tests equal on long strings. | |
void | PrintStatus () |
Print status from mapping. |
String compares are extremely fast, modifications on the other hand are slow, append is a special case wich is optimised.
|
Return a string containing the basename of the string. See the Unix man page for basename. |
|
Return the data of ths string as a null terminated character string. The data may not be modified and the pointer will not be vaild once the string goes out of scope. |
|
Return a string containing the dirname of the string. See the Unix man page for dirname. |
|
Check if the string is empty.
|
|
Format a string as printf does. For now only the convertion codes d, u and s are supported (without additional formating).
|
|
Calculate hash value of string.
|
|
Convert the string to an integer. Valid characters are 0 to 9 and at the first position the '-' character is also allowed. If an invalid character is found, what has been converted so far is returned. For example the string 42e3 would return an integer with the value of 42. There is no overflow check.
|
|
Check is the string conists of ASCII characters only. That is bit 7 is cleared for all characters.
|
|
Check if the string conists of decimal digits only.
|
|
Check if the string conists of hexa decimal digits only.
|
|
Faster than strlen() for short strings and according to my tests equal on long strings.
|
|
Return internal data as a null terminated character string. The data may not be modified and the pointer will not be vaild once the string goes out of scope. |
|
Compares two string objects for non-equality. This is a matter of comparing two pointers and is very fast! |
|
Compare string for equality with other TString object. This is a matter of comparing two pointers and is very fast! |
|
Index operator. Provides read-only access only. |
|
Print string to stdout. newline specifies if a newline should be printed after the string. |
|
Print status from mapping. Used to debug things. |
|
Convert the string to an unsigned integer. Valid characters are 0 to 9. If an invalid character is found, what has been converted so far is returned. For example the string 42e3 would return an integer with the value of 42. There is no overflow check.
|