ROOT  6.06/09
Reference Guide
Macros | Functions
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:

Go to the source code of this file.

Macros

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

Functions

 ClassImp (TString) const UInt_t kHashShift
 
static UInt_t SwapInt (UInt_t x)
 
static void Mash (UInt_t &hash, UInt_t chars)
 Utility used by Hash(). More...
 
UInt_t Hash (const char *str)
 Return a case-sensitive hash value (endian independent). More...
 
uint64_t rotl64 (uint64_t x, int8_t r)
 
static int MemIsEqual (const char *p, const char *q, Ssiz_t n)
 Returns false if strings are not equal. More...
 
TBufferoperator>> (TBuffer &buf, TString *&s)
 Read string from TBuffer. Function declared in ClassDef. 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...
 
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...
 
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...
 
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...
 
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...
 
static char * Format (const char *format, va_list ap)
 Format a string in a circular formatting buffer (using a printf style format descriptor). More...
 
char * Form (const char *va_(fmt),...)
 Formats a string in a circular formatting buffer. More...
 
void Printf (const char *va_(fmt),...)
 Formats a string in a circular formatting buffer and prints the string. More...
 
char * Strip (const char *s, char c)
 Strip leading and trailing c (blanks by default) from a string. More...
 
char * StrDup (const char *str)
 Duplicate the string str. More...
 
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...
 
int UnEscChar (const char *src, char *dst, int dstlen, char *specchars, char)
 Un-escape specchars in src from escchar and copy to dst. More...
 

Macro Definition Documentation

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

Definition at line 663 of file TString.cxx.

#define FORCE_INLINE   inline

Definition at line 656 of file TString.cxx.

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

Definition at line 662 of file TString.cxx.

Function Documentation

ClassImp ( TString  ) const
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 2527 of file TString.cxx.

Referenced by TGeoTrack::Draw(), TApplication::ExecuteFile(), and TFriendElement::TFriendElement().

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

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

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

Referenced by ClassImp().

UInt_t Hash ( const char *  str)

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

Definition at line 504 of file TString.cxx.

static void Mash ( UInt_t hash,
UInt_t  chars 
)
inlinestatic

Utility used by Hash().

Definition at line 494 of file TString.cxx.

Referenced by Hash(), TString::HashCase(), and TString::HashFoldCase().

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

Returns false if strings are not equal.

Definition at line 822 of file TString.cxx.

Referenced by TString::Index().

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

Use the special concatenation constructor.

Definition at line 1421 of file TString.cxx.

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

Use the special concatenation constructor.

Definition at line 1429 of file TString.cxx.

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

Use the special concatenation constructor.

Definition at line 1437 of file TString.cxx.

TString operator+ ( const TString s,
char  c 
)

Add char to string.

Definition at line 1445 of file TString.cxx.

TString operator+ ( const TString s,
Long_t  i 
)

Add integer to string.

Definition at line 1453 of file TString.cxx.

TString operator+ ( const TString s,
ULong_t  i 
)

Add integer to string.

Definition at line 1463 of file TString.cxx.

TString operator+ ( const TString s,
Long64_t  i 
)

Add integer to string.

Definition at line 1473 of file TString.cxx.

TString operator+ ( const TString s,
ULong64_t  i 
)

Add integer to string.

Definition at line 1483 of file TString.cxx.

TString operator+ ( char  c,
const TString s 
)

Add string to integer.

Definition at line 1493 of file TString.cxx.

TString operator+ ( Long_t  i,
const TString s 
)

Add string to integer.

Definition at line 1501 of file TString.cxx.

TString operator+ ( ULong_t  i,
const TString s 
)

Add string to integer.

Definition at line 1511 of file TString.cxx.

TString operator+ ( Long64_t  i,
const TString s 
)

Add string to integer.

Definition at line 1521 of file TString.cxx.

TString operator+ ( ULong64_t  i,
const TString s 
)

Add string to integer.

Definition at line 1531 of file TString.cxx.

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

Write TString or derived to TBuffer.

Definition at line 1366 of file TString.cxx.

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

Compare TString with a char *.

Definition at line 1378 of file TString.cxx.

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

Compare sub-string to char *.

Definition at line 1683 of file TString.cxx.

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

Compare sub-string to string.

Definition at line 1697 of file TString.cxx.

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

Compare two sub-strings.

Definition at line 1707 of file TString.cxx.

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

Read string from TBuffer. Function declared in ClassDef.

Definition at line 1357 of file TString.cxx.

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

uint64_t rotl64 ( uint64_t  x,
int8_t  r 
)
inline

Definition at line 649 of file TString.cxx.

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

Referenced by Format().

char* StrDup ( const char *  str)

Duplicate the string str.

The returned string has to be deleted by the user.

Definition at line 2513 of file TString.cxx.

Referenced by TClassTable::Add(), TGHtml::AddStyle(), TTableSorter::BuildSorter(), TGuiBldDragManager::ChangeImage(), TGuiBldDragManager::ChangePicture(), ClassImp(), TAuthenticate::ClearAuth(), TTableDescriptor::ColumnByName(), TSystem::ConcatFileName(), TKSocket::Connect(), TApplication::CreateApplication(), TDocOutput::CreateClassTypeDefs(), TStyleManager::CreateMacro(), DefaultErrorHandler(), TStyleManager::DoExport(), TStyleManager::DoImportCanvas(), TStyleManager::DoImportMacro(), TTable::Draw(), TSystem::DynamicPathName(), TProofServ::ErrorHandler(), TUnixSystem::ExpandPathName(), TWinNTSystem::ExpandPathName(), TEnvRec::ExpandValue(), TGFileBrowser::FormatFileInfo(), TGSimpleTableInterface::GetColumnHeader(), TAuthenticate::GetDefaultDetails(), TGFontPool::GetFontFamilies(), TRootApplication::GetOptions(), TGApplication::GetOptions(), TWinNTSystem::GetPathInfo(), TGSimpleTableInterface::GetRowHeader(), TUrl::GetSpecialProtocols(), TGSimpleTableInterface::GetValueAsString(), TGuiBldDragManager::HandleKey(), TRootBrowser::HandleMenu(), TWinNTSystem::Init(), init_icon_paths(), Krb5Authenticate(), TTableDescriptor::LearnTable(), TPluginManager::LoadHandlersFromEnv(), TCanvas::MakeDefCanvas(), TRootGuiBuilder::OpenProject(), TObject::Pop(), TPad::Pop(), TRootCanvas::PrintCanvas(), TGTextEditor::PrintText(), TGLSAViewer::ProcessFrameMessage(), TGHtmlBrowser::ProcessMessage(), TGSearchDialog::ProcessMessage(), TGFileDialog::ProcessMessage(), TestMainFrame::ProcessMessage(), TGTextEdit::ProcessMessage(), TRootCanvas::ProcessMessage(), TRootBrowserLite::ProcessMessage(), TTreeViewer::ProcessMessage(), TAuthenticate::PromptPasswd(), TAuthenticate::PromptUser(), TSessionViewer::ReadConfiguration(), TPaveText::ReadFile(), TAuthenticate::ReadRootAuthrc(), TGFileBrowser::RequestFilter(), TGuiBldDragManager::Save(), TGTextEdit::SaveFile(), TGTextEditor::SaveFileAs(), TGuiBldDragManager::SaveFrame(), TGMainFrame::SaveFrameAsCodeOrImage(), TRootGuiBuilder::SaveProject(), TGListTree::Search(), TGHtml::SetBaseUri(), TUnixSystem::SetProgname(), TWinNTSystem::SetProgname(), TSystem::SetProgname(), TTF::SetTextFont(), TAuthenticate::SshAuth(), TAuthenticate::SshError(), TApplication::TApplication(), TAuthenticate::TAuthenticate(), TUnixSystem::TempFileName(), TGFileDialog::TGFileDialog(), TGFSComboBox::TGFSComboBox(), TGHotString::TGHotString(), TGHtmlImage::TGHtmlImage(), TGHtmlMarkupElement::TGHtmlMarkupElement(), TGHtmlUri::TGHtmlUri(), TMapFile::TMapFile(), TMapRec::TMapRec(), TGFileBrowser::ToggleSort(), TMapFile::Update(), TSystem::Which(), TCastorFile::WriteBuffer(), and TClassDocOutput::WriteClassDocHeader().

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

Referenced by ClassImp(), TStreamerInfo::Compile(), TApplication::ProcessLine(), TGQuartz::SetAA(), TControlBarButton::SetAction(), TUrl::SetUrl(), and TSystem::SplitAclicMode().

static UInt_t SwapInt ( UInt_t  x)
inlinestatic

Definition at line 484 of file TString.cxx.

Referenced by Hash(), and TString::HashCase().

TString ToLower ( const TString str)

Return a lower-case version of str.

Definition at line 1393 of file TString.cxx.

Referenced by TNetFile::ConnectServer(), and TNetFile::SysOpen().

TString ToUpper ( const TString str)

Return an upper-case version of str.

Definition at line 1407 of file TString.cxx.

Referenced by TNetXNGFile::ParseOpenMode().

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