Logo ROOT   6.10/09
Reference Guide
List of all members | 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 75 of file TString.h.

Public Member Functions

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

Protected Member Functions

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

Private Member Functions

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

Private Attributes

Ssiz_t fBegin
 
Ssiz_t fExtent
 
TStringfStr
 

Friends

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...
 
class TString
 
class TStringLong
 

#include <TString.h>

Constructor & Destructor Documentation

◆ TSubString() [1/2]

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

Private constructor.

Definition at line 1618 of file TString.cxx.

◆ TSubString() [2/2]

TSubString::TSubString ( const TSubString s)
inline

Definition at line 97 of file TString.h.

Member Function Documentation

◆ AssertElement()

void TSubString::AssertElement ( Ssiz_t  i) const
protected

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

Definition at line 1762 of file TString.cxx.

◆ Data()

const char * TSubString::Data ( ) const
inline

Definition at line 674 of file TString.h.

◆ IsNull()

Bool_t TSubString::IsNull ( ) const
inline

Definition at line 119 of file TString.h.

◆ Length()

Ssiz_t TSubString::Length ( ) const
inline

Definition at line 112 of file TString.h.

◆ operator std::string()

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

Definition at line 109 of file TString.h.

◆ operator std::string_view()

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

Definition at line 108 of file TString.h.

◆ operator!()

int TSubString::operator! ( ) const
inline

Definition at line 120 of file TString.h.

◆ operator()() [1/2]

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

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

Definition at line 1664 of file TString.cxx.

◆ operator()() [2/2]

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

Definition at line 697 of file TString.h.

◆ operator=() [1/3]

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

Assign char* to sub-string.

Definition at line 1683 of file TString.cxx.

◆ operator=() [2/3]

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

Assign string to sub-string.

Definition at line 1672 of file TString.cxx.

◆ operator=() [3/3]

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

Definition at line 700 of file TString.h.

◆ operator[]() [1/2]

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

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

Definition at line 1655 of file TString.cxx.

◆ operator[]() [2/2]

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

Definition at line 694 of file TString.h.

◆ Start()

Ssiz_t TSubString::Start ( ) const
inline

Definition at line 113 of file TString.h.

◆ String()

TString& TSubString::String ( )
inline

Definition at line 114 of file TString.h.

◆ SubStringError()

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

Output error message.

Definition at line 1753 of file TString.cxx.

◆ ToLower()

void TSubString::ToLower ( )

Convert sub-string to lower-case.

Definition at line 1729 of file TString.cxx.

◆ ToUpper()

void TSubString::ToUpper ( )

Convert sub-string to upper-case.

Definition at line 1741 of file TString.cxx.

Friends And Related Function Documentation

◆ operator== [1/3]

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

Compare two sub-strings.

Definition at line 1718 of file TString.cxx.

◆ operator== [2/3]

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

Compare sub-string to string.

Definition at line 1708 of file TString.cxx.

◆ operator== [3/3]

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

Compare sub-string to char *.

Definition at line 1694 of file TString.cxx.

◆ TString

friend class TString
friend

Definition at line 78 of file TString.h.

◆ TStringLong

friend class TStringLong
friend

Definition at line 77 of file TString.h.

Member Data Documentation

◆ fBegin

Ssiz_t TSubString::fBegin
private

Definition at line 86 of file TString.h.

◆ fExtent

Ssiz_t TSubString::fExtent
private

Definition at line 87 of file TString.h.

◆ fStr

TString& TSubString::fStr
private

Definition at line 85 of file TString.h.


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