Logo ROOT   6.08/07
Reference Guide
Macros | Functions | Variables
TString.cxx File Reference
#include "RConfig.h"
#include <stdlib.h>
#include <ctype.h>
#include <list>
#include <algorithm>
#include "snprintf.h"
#include "Varargs.h"
#include "TString.h"
#include "TBuffer.h"
#include "TError.h"
#include "Bytes.h"
#include "TClass.h"
#include "TMD5.h"
#include "TObjArray.h"
#include "TObjString.h"
#include "TVirtualMutex.h"
#include "ThreadLocalStorage.h"
#include <stdint.h>
Include dependency graph for TString.cxx:

Macros

#define BIG_CONSTANT(x)   (x##LLU)
 
#define FORCE_INLINE   inline
 
#define ROTL64(x, y)   rotl64(x,y)
 

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 *va_(fmt),...)
 Formats a string in a circular formatting buffer. More...
 
static char * Format (const char *format, va_list ap)
 Format a string in a circular formatting buffer (using a printf style format descriptor). More...
 
UInt_t Hash (const char *str)
 Return a case-sensitive hash value (endian independent). More...
 
static void Mash (UInt_t &hash, UInt_t chars)
 Utility used by Hash(). More...
 
static int MemIsEqual (const char *p, const char *q, Ssiz_t n)
 Returns false if strings are not equal. More...
 
TString operator+ (const TString &s, const char *cs)
 Use the special concatenation constructor. More...
 
TString operator+ (const char *cs, const TString &s)
 Use the special concatenation constructor. More...
 
TString operator+ (const TString &s1, const TString &s2)
 Use the special concatenation constructor. More...
 
TString operator+ (const TString &s, char c)
 Add char to string. More...
 
TString operator+ (const TString &s, Long_t i)
 Add integer to string. More...
 
TString operator+ (const TString &s, ULong_t i)
 Add integer to string. More...
 
TString operator+ (const TString &s, Long64_t i)
 Add integer to string. More...
 
TString operator+ (const TString &s, ULong64_t i)
 Add integer to string. More...
 
TString operator+ (char c, const TString &s)
 Add string to integer. More...
 
TString operator+ (Long_t i, const TString &s)
 Add string to integer. More...
 
TString operator+ (ULong_t i, const TString &s)
 Add string to integer. More...
 
TString operator+ (Long64_t i, const TString &s)
 Add string to integer. More...
 
TString operator+ (ULong64_t i, const TString &s)
 Add string to integer. More...
 
TBufferoperator<< (TBuffer &buf, const TString *s)
 Write TString or derived to TBuffer. More...
 
Bool_t operator== (const TString &s1, const char *s2)
 Compare TString with a char *. More...
 
Bool_t operator== (const TSubString &ss, const char *cs)
 Compare sub-string to char *. More...
 
Bool_t operator== (const TSubString &ss, const TString &s)
 Compare sub-string to string. More...
 
Bool_t operator== (const TSubString &s1, const TSubString &s2)
 Compare two sub-strings. More...
 
TBufferoperator>> (TBuffer &buf, TString *&s)
 Read string from TBuffer. Function declared in ClassDef. More...
 
void Printf (const char *va_(fmt),...)
 Formats a string in a circular formatting buffer and prints the string. More...
 
uint64_t rotl64 (uint64_t x, int8_t r)
 
static char * SlowFormat (const char *format, va_list ap, int hint)
 Format a string in a formatting buffer (using a printf style format descriptor). More...
 
char * StrDup (const char *str)
 Duplicate the string str. More...
 
char * Strip (const char *s, char c)
 Strip leading and trailing c (blanks by default) from a string. More...
 
static UInt_t SwapInt (UInt_t x)
 
TString ToLower (const TString &str)
 Return a lower-case version of str. More...
 
TString ToUpper (const TString &str)
 Return an upper-case version of str. More...
 
int UnEscChar (const char *src, char *dst, int dstlen, char *specchars, char)
 Un-escape specchars in src from escchar and copy to dst. More...
 

Variables

const UInt_t kHashShift = 5
 

Macro Definition Documentation

◆ BIG_CONSTANT

#define BIG_CONSTANT (   x)    (x##LLU)

Definition at line 664 of file TString.cxx.

◆ FORCE_INLINE

#define FORCE_INLINE   inline

Definition at line 657 of file TString.cxx.

◆ ROTL64

#define ROTL64 (   x,
  y 
)    rotl64(x,y)

Definition at line 663 of file TString.cxx.

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 2528 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 2549 of file TString.cxx.

◆ Form()

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

Formats a string in a circular formatting buffer.

Removes the need to create and delete short lived strings. Don't pass Form() pointers from user code down to ROOT functions as the circular buffer may be overwritten downstream. Use Form() results immediately or use TString::Format() instead.

Definition at line 2446 of file TString.cxx.

◆ Format()

static char* Format ( const char *  format,
va_list  ap 
)
static

Format a string in a circular formatting buffer (using a printf style format descriptor).

Definition at line 2399 of file TString.cxx.

◆ Hash()

UInt_t Hash ( const char *  str)

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

Definition at line 505 of file TString.cxx.

◆ Mash()

static void Mash ( UInt_t hash,
UInt_t  chars 
)
inlinestatic

Utility used by Hash().

Definition at line 495 of file TString.cxx.

◆ MemIsEqual()

static int MemIsEqual ( const char *  p,
const char *  q,
Ssiz_t  n 
)
static

Returns false if strings are not equal.

Definition at line 823 of file TString.cxx.

◆ operator+() [1/13]

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

Use the special concatenation constructor.

Definition at line 1422 of file TString.cxx.

◆ operator+() [2/13]

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

Use the special concatenation constructor.

Definition at line 1430 of file TString.cxx.

◆ operator+() [3/13]

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

Use the special concatenation constructor.

Definition at line 1438 of file TString.cxx.

◆ operator+() [4/13]

TString operator+ ( const TString s,
char  c 
)

Add char to string.

Definition at line 1446 of file TString.cxx.

◆ operator+() [5/13]

TString operator+ ( const TString s,
Long_t  i 
)

Add integer to string.

Definition at line 1454 of file TString.cxx.

◆ operator+() [6/13]

TString operator+ ( const TString s,
ULong_t  i 
)

Add integer to string.

Definition at line 1464 of file TString.cxx.

◆ operator+() [7/13]

TString operator+ ( const TString s,
Long64_t  i 
)

Add integer to string.

Definition at line 1474 of file TString.cxx.

◆ operator+() [8/13]

TString operator+ ( const TString s,
ULong64_t  i 
)

Add integer to string.

Definition at line 1484 of file TString.cxx.

◆ operator+() [9/13]

TString operator+ ( char  c,
const TString s 
)

Add string to integer.

Definition at line 1494 of file TString.cxx.

◆ operator+() [10/13]

TString operator+ ( Long_t  i,
const TString s 
)

Add string to integer.

Definition at line 1502 of file TString.cxx.

◆ operator+() [11/13]

TString operator+ ( ULong_t  i,
const TString s 
)

Add string to integer.

Definition at line 1512 of file TString.cxx.

◆ operator+() [12/13]

TString operator+ ( Long64_t  i,
const TString s 
)

Add string to integer.

Definition at line 1522 of file TString.cxx.

◆ operator+() [13/13]

TString operator+ ( ULong64_t  i,
const TString s 
)

Add string to integer.

Definition at line 1532 of file TString.cxx.

◆ operator<<()

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

Write TString or derived to TBuffer.

Definition at line 1367 of file TString.cxx.

◆ operator==() [1/4]

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

Compare TString with a char *.

Definition at line 1379 of file TString.cxx.

◆ operator==() [2/4]

Bool_t operator== ( const TSubString ss,
const char *  cs 
)

Compare sub-string to char *.

Definition at line 1684 of file TString.cxx.

◆ operator==() [3/4]

Bool_t operator== ( const TSubString ss,
const TString s 
)

Compare sub-string to string.

Definition at line 1698 of file TString.cxx.

◆ operator==() [4/4]

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

Compare two sub-strings.

Definition at line 1708 of file TString.cxx.

◆ operator>>()

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

Read string from TBuffer. Function declared in ClassDef.

Definition at line 1358 of file TString.cxx.

◆ Printf()

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

Formats a string in a circular formatting buffer and prints the string.

Appends a newline. If gPrintViaErrorHandler is true it will print via the currently active ROOT error handler.

Definition at line 2460 of file TString.cxx.

◆ rotl64()

uint64_t rotl64 ( uint64_t  x,
int8_t  r 
)
inline

Definition at line 650 of file TString.cxx.

◆ SlowFormat()

static char* SlowFormat ( const char *  format,
va_list  ap,
int  hint 
)
static

Format a string in a formatting buffer (using a printf style format descriptor).

Definition at line 2351 of file TString.cxx.

◆ StrDup()

char* StrDup ( const char *  str)

Duplicate the string str.

The returned string has to be deleted by the user.

Definition at line 2514 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 2478 of file TString.cxx.

◆ SwapInt()

static UInt_t SwapInt ( UInt_t  x)
inlinestatic

Definition at line 485 of file TString.cxx.

◆ ToLower()

TString ToLower ( const TString str)

Return a lower-case version of str.

Definition at line 1394 of file TString.cxx.

◆ ToUpper()

TString ToUpper ( const TString str)

Return an upper-case version of str.

Definition at line 1408 of file TString.cxx.

◆ UnEscChar()

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

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

Definition at line 2573 of file TString.cxx.

Variable Documentation

◆ kHashShift

const UInt_t kHashShift = 5

Definition at line 69 of file TString.cxx.