Logo ROOT  
Reference Guide
TString.h File Reference
#include "TMathBase.h"
#include "ROOT/RStringView.hxx"
#include "ROOT/TypeTraits.hxx"
#include <iosfwd>
#include <stdarg.h>
#include <stdio.h>
#include <string>
Include dependency graph for TString.h:

Classes

struct  TString::LongStr_t
 
struct  TString::RawStr_t
 
struct  TString::Rep_t
 
struct  TString::ShortStr_t
 
class  TString
 Basic string class. More...
 
class  TSubString
 A zero length substring is legal. More...
 
union  TString::UStr_t
 

Namespaces

namespace  llvm
 

Functions

char * Compress (const char *str)
 Remove all blanks from the string str. More...
 
int EscChar (const char *src, char *dst, int dstlen, char *specchars, char escchar)
 Escape specchars in src with escchar and copy to dst. More...
 
char * Form (const char *fmt,...)
 
UInt_t Hash (const char *s)
 Return a case-sensitive hash value (endian independent). More...
 
UInt_t Hash (const TString &s)
 
UInt_t Hash (const TString *s)
 
Bool_t operator!= (const char *s1, const TString &s2)
 
Bool_t operator!= (const char *s1, const TSubString &s2)
 
Bool_t operator!= (const TString &s1, const char *s2)
 
Bool_t operator!= (const TString &s1, const TString &s2)
 
Bool_t operator!= (const TString &s1, const TSubString &s2)
 
Bool_t operator!= (const TSubString &s1, const char *s2)
 
Bool_t operator!= (const TSubString &s1, const TString &s2)
 
Bool_t operator!= (const TSubString &s1, const TSubString &s2)
 
TString operator+ (char c, const TString &s)
 Add string to char. More...
 
TString operator+ (const char *cs, const TString &s)
 Use the special concatenation constructor. More...
 
TString operator+ (const TString &s, char c)
 Add char to string. More...
 
TString operator+ (const TString &s, const char *cs)
 Use the special concatenation constructor. More...
 
TString operator+ (const TString &s1, const TString &s2)
 Use the special concatenation constructor. More...
 
template<class T >
std::enable_if< ROOT::TypeTraits::IsFloatNumeral< T >::value, TString >::type operator+ (T f, const TString &s)
 
template<class T >
std::enable_if< ROOT::TypeTraits::IsSignedNumeral< T >::value, TString >::type operator+ (T i, const TString &s)
 
template<class T >
std::enable_if< ROOT::TypeTraits::IsUnsignedNumeral< T >::value, TString >::type operator+ (T u, const TString &s)
 
template<class T >
std::enable_if< ROOT::TypeTraits::IsFloatNumeral< T >::value, TString >::type operator+ (TString s, T f)
 
template<class T >
std::enable_if< ROOT::TypeTraits::IsSignedNumeral< T >::value, TString >::type operator+ (TString s, T i)
 
template<class T >
std::enable_if< ROOT::TypeTraits::IsUnsignedNumeral< T >::value, TString >::type operator+ (TString s, T u)
 
std::string & operator+= (std::string &left, const TString &right)
 
Bool_t operator< (const char *s1, const TString &s2)
 
Bool_t operator< (const TString &s1, const char *s2)
 
Bool_t operator< (const TString &s1, const TString &s2)
 
std::ostream & operator<< (std::ostream &str, const TString &s)
 Write string to stream. More...
 
TBufferoperator<< (TBuffer &buf, const TString *sp)
 Write TString or derived to TBuffer. More...
 
Bool_t operator<= (const char *s1, const TString &s2)
 
Bool_t operator<= (const TString &s1, const char *s2)
 
Bool_t operator<= (const TString &s1, const TString &s2)
 
Bool_t operator== (const char *s1, const std::string_view &s2)
 
Bool_t operator== (const char *s1, const TString &s2)
 
Bool_t operator== (const char *s1, const TSubString &s2)
 
Bool_t operator== (const std::string_view &s1, const char *s2)
 
Bool_t operator== (const TString &s1, const char *s2)
 Compare TString with a char *. More...
 
Bool_t operator== (const TString &s1, const TString &s2)
 
Bool_t operator== (const TString &s1, const TSubString &s2)
 
Bool_t operator== (const TSubString &s1, const char *s2)
 Compare sub-string to char *. More...
 
Bool_t operator== (const TSubString &s1, const TString &s2)
 Compare sub-string to string. More...
 
Bool_t operator== (const TSubString &s1, const TSubString &s2)
 Compare two sub-strings. More...
 
Bool_t operator> (const char *s1, const TString &s2)
 
Bool_t operator> (const TString &s1, const char *s2)
 
Bool_t operator> (const TString &s1, const TString &s2)
 
Bool_t operator>= (const char *s1, const TString &s2)
 
Bool_t operator>= (const TString &s1, const char *s2)
 
Bool_t operator>= (const TString &s1, const TString &s2)
 
std::istream & operator>> (std::istream &str, TString &s)
 Read string from stream. More...
 
TBufferoperator>> (TBuffer &buf, TString *&sp)
 Read string from TBuffer. Function declared in ClassDef. More...
 
void Printf (const char *fmt,...)
 
char * StrDup (const char *str)
 Duplicate the string str. More...
 
char * Strip (const char *str, char c=' ')
 Strip leading and trailing c (blanks by default) from a string. More...
 
TString ToLower (const TString &s)
 Return a lower-case version of str. More...
 
TString ToUpper (const TString &s)
 Return an upper-case version of str. More...
 
int UnEscChar (const char *src, char *dst, int dstlen, char *specchars, char escchar)
 Un-escape specchars in src from escchar and copy to dst. More...
 

Function Documentation

◆ Compress()

char * Compress ( const char *  str)

Remove all blanks from the string str.

The returned string has to be deleted by the user.

Definition at line 2504 of file TString.cxx.

◆ EscChar()

int EscChar ( const char *  src,
char *  dst,
int  dstlen,
char *  specchars,
char  escchar 
)

Escape specchars in src with escchar and copy to dst.

Definition at line 2525 of file TString.cxx.

◆ Form()

char * Form ( const char *  fmt,
  ... 
)

◆ Hash() [1/3]

UInt_t Hash ( const char *  s)

Return a case-sensitive hash value (endian independent).

Definition at line 537 of file TString.cxx.

◆ Hash() [2/3]

UInt_t Hash ( const TString s)
inline

Definition at line 481 of file TString.h.

◆ Hash() [3/3]

UInt_t Hash ( const TString s)
inline

Definition at line 482 of file TString.h.

◆ operator!=() [1/8]

Bool_t operator!= ( const char *  s1,
const TString s2 
)
inline

Definition at line 792 of file TString.h.

◆ operator!=() [2/8]

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

Definition at line 829 of file TString.h.

◆ operator!=() [3/8]

Bool_t operator!= ( const TString s1,
const char *  s2 
)
inline

Definition at line 774 of file TString.h.

◆ operator!=() [4/8]

Bool_t operator!= ( const TString s1,
const TString s2 
)
inline

Definition at line 758 of file TString.h.

◆ operator!=() [5/8]

Bool_t operator!= ( const TString s1,
const TSubString s2 
)
inline

Definition at line 826 of file TString.h.

◆ operator!=() [6/8]

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

Definition at line 817 of file TString.h.

◆ operator!=() [7/8]

Bool_t operator!= ( const TSubString s1,
const TString s2 
)
inline

Definition at line 820 of file TString.h.

◆ operator!=() [8/8]

Bool_t operator!= ( const TSubString s1,
const TSubString s2 
)
inline

Definition at line 823 of file TString.h.

◆ operator+() [1/11]

TString operator+ ( char  c,
const TString s 
)

Add string to char.

Definition at line 1490 of file TString.cxx.

◆ operator+() [2/11]

TString operator+ ( const char *  cs,
const TString s 
)

Use the special concatenation constructor.

Definition at line 1466 of file TString.cxx.

◆ operator+() [3/11]

TString operator+ ( const TString s,
char  c 
)

Add char to string.

Definition at line 1482 of file TString.cxx.

◆ operator+() [4/11]

TString operator+ ( const TString s,
const char *  cs 
)

Use the special concatenation constructor.

Definition at line 1458 of file TString.cxx.

◆ operator+() [5/11]

TString operator+ ( const TString s1,
const TString s2 
)

Use the special concatenation constructor.

Definition at line 1474 of file TString.cxx.

◆ operator+() [6/11]

template<class T >
std::enable_if< ROOT::TypeTraits::IsFloatNumeral< T >::value, TString >::type operator+ ( f,
const TString s 
)
inline

Definition at line 551 of file TString.h.

◆ operator+() [7/11]

template<class T >
std::enable_if< ROOT::TypeTraits::IsSignedNumeral< T >::value, TString >::type operator+ ( i,
const TString s 
)
inline

Definition at line 531 of file TString.h.

◆ operator+() [8/11]

template<class T >
std::enable_if< ROOT::TypeTraits::IsUnsignedNumeral< T >::value, TString >::type operator+ ( u,
const TString s 
)
inline

Definition at line 541 of file TString.h.

◆ operator+() [9/11]

template<class T >
std::enable_if< ROOT::TypeTraits::IsFloatNumeral< T >::value, TString >::type operator+ ( TString  s,
f 
)
inline

Definition at line 526 of file TString.h.

◆ operator+() [10/11]

template<class T >
std::enable_if< ROOT::TypeTraits::IsSignedNumeral< T >::value, TString >::type operator+ ( TString  s,
i 
)
inline

Definition at line 516 of file TString.h.

◆ operator+() [11/11]

template<class T >
std::enable_if< ROOT::TypeTraits::IsUnsignedNumeral< T >::value, TString >::type operator+ ( TString  s,
u 
)
inline

Definition at line 521 of file TString.h.

◆ operator+=()

std::string & operator+= ( std::string &  left,
const TString right 
)
inline

Definition at line 473 of file TString.h.

◆ operator<() [1/3]

Bool_t operator< ( const char *  s1,
const TString s2 
)
inline

Definition at line 795 of file TString.h.

◆ operator<() [2/3]

Bool_t operator< ( const TString s1,
const char *  s2 
)
inline

Definition at line 777 of file TString.h.

◆ operator<() [3/3]

Bool_t operator< ( const TString s1,
const TString s2 
)
inline

Definition at line 761 of file TString.h.

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream &  str,
const TString s 
)

Write string to stream.

Definition at line 171 of file Stringio.cxx.

◆ operator<<() [2/2]

TBuffer & operator<< ( TBuffer buf,
const TString sp 
)

Write TString or derived to TBuffer.

Definition at line 1403 of file TString.cxx.

◆ operator<=() [1/3]

Bool_t operator<= ( const char *  s1,
const TString s2 
)
inline

Definition at line 801 of file TString.h.

◆ operator<=() [2/3]

Bool_t operator<= ( const TString s1,
const char *  s2 
)
inline

Definition at line 783 of file TString.h.

◆ operator<=() [3/3]

Bool_t operator<= ( const TString s1,
const TString s2 
)
inline

Definition at line 767 of file TString.h.

◆ operator==() [1/10]

Bool_t operator== ( const char *  s1,
const std::string_view s2 
)
inline

Definition at line 834 of file TString.h.

◆ operator==() [2/10]

Bool_t operator== ( const char *  s1,
const TString s2 
)
inline

Definition at line 789 of file TString.h.

◆ operator==() [3/10]

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

Definition at line 814 of file TString.h.

◆ operator==() [4/10]

Bool_t operator== ( const std::string_view s1,
const char *  s2 
)
inline

Definition at line 839 of file TString.h.

◆ operator==() [5/10]

Bool_t operator== ( const TString s1,
const char *  s2 
)

Compare TString with a char *.

Definition at line 1415 of file TString.cxx.

◆ operator==() [6/10]

Bool_t operator== ( const TString s1,
const TString s2 
)
inline

Definition at line 752 of file TString.h.

◆ operator==() [7/10]

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

Definition at line 811 of file TString.h.

◆ operator==() [8/10]

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

Compare sub-string to char *.

Definition at line 1640 of file TString.cxx.

◆ operator==() [9/10]

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

Compare sub-string to string.

Definition at line 1654 of file TString.cxx.

◆ operator==() [10/10]

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

Compare two sub-strings.

Definition at line 1664 of file TString.cxx.

◆ operator>() [1/3]

Bool_t operator> ( const char *  s1,
const TString s2 
)
inline

Definition at line 798 of file TString.h.

◆ operator>() [2/3]

Bool_t operator> ( const TString s1,
const char *  s2 
)
inline

Definition at line 780 of file TString.h.

◆ operator>() [3/3]

Bool_t operator> ( const TString s1,
const TString s2 
)
inline

Definition at line 764 of file TString.h.

◆ operator>=() [1/3]

Bool_t operator>= ( const char *  s1,
const TString s2 
)
inline

Definition at line 804 of file TString.h.

◆ operator>=() [2/3]

Bool_t operator>= ( const TString s1,
const char *  s2 
)
inline

Definition at line 786 of file TString.h.

◆ operator>=() [3/3]

Bool_t operator>= ( const TString s1,
const TString s2 
)
inline

Definition at line 770 of file TString.h.

◆ operator>>() [1/2]

std::istream & operator>> ( std::istream &  str,
TString s 
)

Read string from stream.

Definition at line 163 of file Stringio.cxx.

◆ operator>>() [2/2]

TBuffer & operator>> ( TBuffer buf,
TString *&  sp 
)

Read string from TBuffer. Function declared in ClassDef.

Definition at line 1394 of file TString.cxx.

◆ Printf()

void Printf ( const char *  fmt,
  ... 
)

◆ StrDup()

char * StrDup ( const char *  str)

Duplicate the string str.

The returned string has to be deleted by the user.

Definition at line 2490 of file TString.cxx.

◆ Strip()

char * Strip ( const char *  s,
char  c 
)

Strip leading and trailing c (blanks by default) from a string.

The returned string has to be deleted by the user.

Definition at line 2454 of file TString.cxx.

◆ ToLower()

TString ToLower ( const TString s)

Return a lower-case version of str.

Definition at line 1430 of file TString.cxx.

◆ ToUpper()

TString ToUpper ( const TString s)

Return an upper-case version of str.

Definition at line 1444 of file TString.cxx.

◆ UnEscChar()

int UnEscChar ( const char *  src,
char *  dst,
int  dstlen,
char *  specchars,
char  escchar 
)

Un-escape specchars in src from escchar and copy to dst.

Definition at line 2549 of file TString.cxx.