class TSubString


TString

Basic string class.

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


Function Members (Methods)

public:
TSubString(const TSubString& s)
~TSubString()
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
TString&String()
voidToLower()
voidToUpper()
protected:
voidAssertElement(Ssiz_t i) const
voidSubStringError(Ssiz_t, Ssiz_t, Ssiz_t) const
private:
TSubString(const TString& s, Ssiz_t start, Ssiz_t len)

Data Members

private:
Ssiz_tfBeginIndex of starting character
Ssiz_tfExtentLength of TSubString
TString&fStrReferenced string

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TSubString(const TString& s, Ssiz_t start, Ssiz_t len)
 Private constructor.
char& operator[](Ssiz_t i)
 Return character at pos i from sub-string. Check validity of i.
char& operator()(Ssiz_t i)
 Return character at pos i from sub-string. No check on i.
TSubString& operator=(const TString &str)
 Assign string to sub-string.
TSubString& operator=(const char *cs)
 Assign char* to sub-string.
void ToLower()
 Convert sub-string to lower-case.
void ToUpper()
 Convert sub-string to upper-case.
void SubStringError(Ssiz_t , Ssiz_t , Ssiz_t ) const
 Output error message.
void AssertElement(Ssiz_t i) const
 Check to make sure a sub-string index is in range.
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; }
TSubString(const TString& s, Ssiz_t start, Ssiz_t len)
 NB: the only constructor is private
Ssiz_t Start()
{ return fBegin; }
Bool_t IsNull()
 For detecting null substrings
{ return fBegin == kNPOS; }
int operator!()
{ return fBegin == kNPOS; }

Author: Fons Rademakers 04/08/95
Last change: root/base:$Id: TString.h 24963 2008-07-28 13:49:23Z rdm $
Last generated: 2008-08-06 08:07
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.