ROOT  6.06/09
Reference Guide
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
TSubString Class Reference

A zero length substring is legal.

It can start at any character. It is considered to be "pointing" to just before the character.

A "null" substring is a zero length substring that starts with the nonsense index kNPOS. It can be detected with the member function IsNull().

Definition at line 83 of file TString.h.

Public Member Functions

 TSubString (const TSubString &s)
 
TSubStringoperator= (const char *s)
 Assign char* to sub-string. More...
 
TSubStringoperator= (const TString &s)
 Assign string to sub-string. More...
 
TSubStringoperator= (const TSubString &s)
 
char & operator() (Ssiz_t i)
 Return character at pos i from sub-string. No check on i. More...
 
char & operator[] (Ssiz_t i)
 Return character at pos i from sub-string. Check validity of i. More...
 
char operator() (Ssiz_t i) const
 
char operator[] (Ssiz_t i) const
 
 operator std::string_view () const
 
 operator std::string () const
 
const char * Data () const
 
Ssiz_t Length () const
 
Ssiz_t Start () const
 
TStringString ()
 
void ToLower ()
 Convert sub-string to lower-case. More...
 
void ToUpper ()
 Convert sub-string to upper-case. More...
 
Bool_t IsNull () const
 
int operator! () const
 

Protected Member Functions

void SubStringError (Ssiz_t, Ssiz_t, Ssiz_t) const
 Output error message. More...
 
void AssertElement (Ssiz_t i) const
 Check to make sure a sub-string index is in range. More...
 

Private Member Functions

 TSubString (const TString &s, Ssiz_t start, Ssiz_t len)
 Private constructor. More...
 

Private Attributes

TStringfStr
 
Ssiz_t fBegin
 
Ssiz_t fExtent
 

Friends

class TStringLong
 
class TString
 
Bool_t operator== (const TSubString &s1, const TSubString &s2)
 Compare two sub-strings. More...
 
Bool_t operator== (const TSubString &s1, const TString &s2)
 Compare sub-string to string. More...
 
Bool_t operator== (const TSubString &s1, const char *s2)
 Compare sub-string to char *. More...
 

#include <TString.h>

+ Collaboration diagram for TSubString:

Constructor & Destructor Documentation

TSubString::TSubString ( const TString s,
Ssiz_t  start,
Ssiz_t  len 
)
private

Private constructor.

Definition at line 1607 of file TString.cxx.

TSubString::TSubString ( const TSubString s)
inline

Definition at line 105 of file TString.h.

Member Function Documentation

void TSubString::AssertElement ( Ssiz_t  i) const
protected

Check to make sure a sub-string index is in range.

Definition at line 1751 of file TString.cxx.

Referenced by operator[]().

const char * TSubString::Data ( ) const
inline
Bool_t TSubString::IsNull ( ) const
inline
Ssiz_t TSubString::Length ( ) const
inline
TSubString::operator std::string ( ) const
inline

Definition at line 117 of file TString.h.

TSubString::operator std::string_view ( ) const
inline

Definition at line 116 of file TString.h.

int TSubString::operator! ( ) const
inline

Definition at line 128 of file TString.h.

char & TSubString::operator() ( Ssiz_t  i)

Return character at pos i from sub-string. No check on i.

Definition at line 1653 of file TString.cxx.

char TSubString::operator() ( Ssiz_t  i) const
inline

Definition at line 692 of file TString.h.

TSubString & TSubString::operator= ( const char *  s)

Assign char* to sub-string.

Definition at line 1672 of file TString.cxx.

TSubString & TSubString::operator= ( const TString s)

Assign string to sub-string.

Definition at line 1661 of file TString.cxx.

TSubString & TSubString::operator= ( const TSubString s)
inline

Definition at line 695 of file TString.h.

char & TSubString::operator[] ( Ssiz_t  i)

Return character at pos i from sub-string. Check validity of i.

Definition at line 1644 of file TString.cxx.

char TSubString::operator[] ( Ssiz_t  i) const
inline

Definition at line 689 of file TString.h.

Ssiz_t TSubString::Start ( ) const
inline
TString& TSubString::String ( )
inline

Definition at line 122 of file TString.h.

Referenced by TDocHtmlDirective::AddLine(), TDocOutput::AddLink(), and TTree::CopyEntries().

void TSubString::SubStringError ( Ssiz_t  sr,
Ssiz_t  start,
Ssiz_t  n 
) const
protected

Output error message.

Definition at line 1742 of file TString.cxx.

void TSubString::ToLower ( )

Convert sub-string to lower-case.

Definition at line 1718 of file TString.cxx.

void TSubString::ToUpper ( )

Convert sub-string to upper-case.

Definition at line 1730 of file TString.cxx.

Friends And Related Function Documentation

Bool_t operator== ( const TSubString s1,
const TSubString s2 
)
friend

Compare two sub-strings.

Definition at line 1707 of file TString.cxx.

Bool_t operator== ( const TSubString s1,
const TString s2 
)
friend

Compare sub-string to string.

Definition at line 1697 of file TString.cxx.

Bool_t operator== ( const TSubString s1,
const char *  s2 
)
friend

Compare sub-string to char *.

Definition at line 1683 of file TString.cxx.

friend class TString
friend

Definition at line 86 of file TString.h.

friend class TStringLong
friend

Definition at line 85 of file TString.h.

Member Data Documentation

Ssiz_t TSubString::fBegin
private

Definition at line 94 of file TString.h.

Referenced by Data(), operator()(), operator=(), operator==(), operator[](), Start(), ToLower(), and ToUpper().

Ssiz_t TSubString::fExtent
private

Definition at line 95 of file TString.h.

Referenced by Length(), operator=(), operator==(), ToLower(), and ToUpper().

TString& TSubString::fStr
private

Definition at line 93 of file TString.h.

Referenced by Data(), operator()(), operator=(), operator==(), operator[](), String(), ToLower(), and ToUpper().


The documentation for this class was generated from the following files: