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()
{ 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()
{ 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()
{ return fBegin; }
void ToLower()
void ToUpper()
Bool_t IsNull()
 For detecting null substrings
{ return fBegin == kNPOS; }
int operator!()
{ return fBegin == kNPOS; }

Author: Fons Rademakers 04/08/95
Last update: root/base:$Id: TString.h 20877 2007-11-19 11:17:07Z rdm $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.