ROOT logo
ROOT » CORE » BASE » TSubString

class TSubString


Basic string class.

Cannot be stored in a TCollection... use TObjString instead.

Function Members (Methods)

TSubString(const TSubString& s)
const char*Data() const
Bool_tIsNull() const
Ssiz_tLength() const
intoperator!() const
char&operator()(Ssiz_t i)
charoperator()(Ssiz_t i) const
TSubString&operator=(const char* s)
TSubString&operator=(const TString& s)
TSubString&operator=(const TSubString& s)
char&operator[](Ssiz_t i)
charoperator[](Ssiz_t i) const
Ssiz_tStart() const
voidAssertElement(Ssiz_t i) const
voidSubStringError(Ssiz_t, Ssiz_t, Ssiz_t) const
TSubString(const TString& s, Ssiz_t start, Ssiz_t len)

Data Members

Ssiz_tfBeginIndex of starting character
Ssiz_tfExtentLength of TSubString
TString&fStrReferenced string

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

const char * Data() const
{ return fStr.Data() + fBegin; }
char operator[](Ssiz_t i)
 Access to elements of sub-string with bounds checking
{ AssertElement(i); return fStr.fData[fBegin+i]; }
char operator()(Ssiz_t i)
{ return fStr.fData[fBegin+i]; }
TSubString & operator=(const TSubString &s)
{ fStr = s.fStr; fBegin = s.fBegin; fExtent = s.fExtent; return *this; }
Ssiz_t Length() const
{ return fNchars; }
char & operator[](Ssiz_t i)
{ return ((char*)(this+1))[i]; }
TSubString(const TString& s, Ssiz_t start, Ssiz_t len)
 NB: the only constructor is private
void SubStringError(Ssiz_t , Ssiz_t , Ssiz_t ) const
void AssertElement(Ssiz_t i) const
TSubString(const TSubString& s)
{ }
TSubString & operator=(const char *s)
TSubString & operator=(const TString &s)
char & operator()(Ssiz_t i)
Ssiz_t Start() const
{ return fBegin; }
void ToLower()
void ToUpper()
Bool_t IsNull() const
 For detecting null substrings
{ return fBegin == kNPOS; }
int operator!() const
{ return fBegin == kNPOS; }