TString Basic string class. Cannot be stored in a TCollection... use TObjString instead. The underlying string is stored as a char* that can be accessed via TString::Data(). TString provides Short String Optimization (SSO) so that short strings (<15 on 64-bit and <11 on 32-bit) are contained in the TString internal data structure without the need for mallocing the required space. Substring operations are provided by the TSubString class, which holds a reference to the original string and its data, along with the offset and length of the substring. To retrieve the substring as a TString, construct a TString from it, eg: root [0] TString s("hello world") root [1] TString s2( s(0,5) ) root [2] s2 (class TString)"hello"
~TSubString() | |
const char* | Data() const |
Bool_t | IsNull() const |
Ssiz_t | Length() const |
int | operator!() const |
char& | operator()(Ssiz_t i) |
char | operator()(Ssiz_t i) const |
TSubString& | operator=(const char* s) |
TSubString& | operator=(const TString& s) |
TSubString& | operator=(const TSubString& s) |
char& | operator[](Ssiz_t i) |
char | operator[](Ssiz_t i) const |
Ssiz_t | Start() const |
TString& | String() |
void | ToLower() |
void | ToUpper() |
TSubString(const TSubString& s) |
void | AssertElement(Ssiz_t i) const |
void | SubStringError(Ssiz_t, Ssiz_t, Ssiz_t) const |
TSubString(const TString& s, Ssiz_t start, Ssiz_t len) |
Inheritance Chart: | |||||
|
Return a pointer to the beginning of the substring. Note that the terminating null is in the same place as for the original TString, so this method is not appropriate for converting the TSubString to a string. To do that, construct a TString from the TSubString. For example: root [0] TString s("hello world") root [1] TSubString sub=s(0, 5) root [2] sub.Data() (const char* 0x857c8b8)"hello world" root [3] TString substr(sub) root [4] substr (class TString)"hello"
Access to elements of sub-string with bounds checking
{ AssertElement(i); return fStr.GetPointer()[fBegin+i]; }