library: libCore #include "TString.h" |
TString
class description - header file - source file
viewCVS header - viewCVS source
class TString
Function Members (Methods)
Display options:
public:
| TString() |
| TString(Ssiz_t ic) |
| TString(const TString& s) |
| TString(const char* s) |
| TString(const string& s) |
| TString(char c) |
| TString(const TSubString& sub) |
| TString(const char* s, Ssiz_t n) |
| TString(char c, Ssiz_t s) |
virtual | ~TString() |
TString& | Append(const char* cs) |
TString& | Append(const TString& s) |
TString& | Append(const char* cs, Ssiz_t n) |
TString& | Append(const TString& s, Ssiz_t n) |
TString& | Append(char c, Ssiz_t rep = 1) |
Double_t | Atof() const |
Int_t | Atoi() const |
Long64_t | Atoll() const |
Bool_t | BeginsWith(const char* s, TString::ECaseCompare cmp = kExact) const |
Bool_t | BeginsWith(const TString& pat, TString::ECaseCompare cmp = kExact) const |
Ssiz_t | Capacity() const |
Ssiz_t | Capacity(Ssiz_t n) |
TString& | Chop() |
static TClass* | Class() |
int | CompareTo(const char* cs, TString::ECaseCompare cmp = kExact) const |
int | CompareTo(const TString& st, TString::ECaseCompare cmp = kExact) const |
Bool_t | Contains(const TRegexp& pat) const |
Bool_t | Contains(TPRegexp& pat) const |
Bool_t | Contains(const char* s, TString::ECaseCompare cmp = kExact) const |
Bool_t | Contains(const TString& pat, TString::ECaseCompare cmp = kExact) const |
TString | Copy() const |
Int_t | CountChar(Int_t c) const |
const char* | Data() const |
Bool_t | EndsWith(const char* pat, TString::ECaseCompare cmp = kExact) const |
virtual void | FillBuffer(char*& buffer) |
Ssiz_t | First(char c) const |
Ssiz_t | First(const char* cs) const |
void | Form(const char* fmt) |
static TString | Format(const char* fmt) |
static Ssiz_t | GetInitialCapacity() |
static Ssiz_t | GetMaxWaste() |
static Ssiz_t | GetResizeIncrement() |
Bool_t | Gets(FILE* fp, Bool_t chop = kTRUE) |
UInt_t | Hash(TString::ECaseCompare cmp = kExact) const |
Ssiz_t | Index(const TRegexp& pat, Ssiz_t i = 0) const |
Ssiz_t | Index(TPRegexp& pat, Ssiz_t i = 0) const |
Ssiz_t | Index(const char* s, Ssiz_t i = 0, TString::ECaseCompare cmp = kExact) const |
Ssiz_t | Index(const TString& s, Ssiz_t i = 0, TString::ECaseCompare cmp = kExact) const |
Ssiz_t | Index(const TRegexp& pat, Ssiz_t* ext, Ssiz_t i = 0) const |
Ssiz_t | Index(TPRegexp& pat, Ssiz_t* ext, Ssiz_t i = 0) const |
Ssiz_t | Index(const char* pat, Ssiz_t patlen, Ssiz_t i, TString::ECaseCompare cmp) const |
Ssiz_t | Index(const TString& pat, Ssiz_t patlen, Ssiz_t i, TString::ECaseCompare cmp) const |
static Ssiz_t | InitialCapacity(Ssiz_t ic = 15) |
TString& | Insert(Ssiz_t pos, const char* cs) |
TString& | Insert(Ssiz_t pos, const TString& s) |
TString& | Insert(Ssiz_t pos, const char* cs, Ssiz_t n) |
TString& | Insert(Ssiz_t pos, const TString& s, Ssiz_t n) |
virtual TClass* | IsA() const |
Bool_t | IsAlnum() const |
Bool_t | IsAlpha() const |
Bool_t | IsAscii() const |
Bool_t | IsDigit() const |
Bool_t | IsFloat() const |
Bool_t | IsHex() const |
Bool_t | IsNull() const |
Bool_t | IsWhitespace() const |
Ssiz_t | Last(char c) const |
Ssiz_t | Length() const |
static Ssiz_t | MaxWaste(Ssiz_t mw = 15) |
Bool_t | MaybeRegexp() const |
Bool_t | MaybeWildcard() const |
char* | operator const char*() const |
char& | operator()(Ssiz_t i) |
TSubString | operator()(const TRegexp& re) |
TSubString | operator()(TPRegexp& re) |
char | operator()(Ssiz_t i) const |
TSubString | operator()(const TRegexp& re) const |
TSubString | operator()(TPRegexp& re) const |
TSubString | operator()(Ssiz_t start, Ssiz_t len) |
TSubString | operator()(const TRegexp& re, Ssiz_t start) |
TSubString | operator()(TPRegexp& re, Ssiz_t start) |
TSubString | operator()(Ssiz_t start, Ssiz_t len) const |
TSubString | operator()(const TRegexp& re, Ssiz_t start) const |
TSubString | operator()(TPRegexp& re, Ssiz_t start) const |
TString& | operator+=(const char* cs) |
TString& | operator+=(const TString& s) |
TString& | operator+=(char c) |
TString& | operator+=(Short_t i) |
TString& | operator+=(UShort_t i) |
TString& | operator+=(Int_t i) |
TString& | operator+=(UInt_t i) |
TString& | operator+=(Long_t i) |
TString& | operator+=(ULong_t i) |
TString& | operator+=(Float_t f) |
TString& | operator+=(Double_t f) |
TString& | operator+=(Long64_t l) |
TString& | operator+=(ULong64_t ul) |
TString& | operator=(char s) |
TString& | operator=(const char* s) |
TString& | operator=(const TString& s) |
TString& | operator=(const string& s) |
TString& | operator=(const TSubString& s) |
char& | operator[](Ssiz_t i) |
char | operator[](Ssiz_t i) const |
TString& | Prepend(const char* cs) |
TString& | Prepend(const TString& s) |
TString& | Prepend(const char* cs, Ssiz_t n) |
TString& | Prepend(const TString& s, Ssiz_t n) |
TString& | Prepend(char c, Ssiz_t rep = 1) |
void | Puts(FILE* fp) |
virtual void | ReadBuffer(char*& buffer) |
istream& | ReadFile(istream& str) |
istream& | ReadLine(istream& str, Bool_t skipWhite = kTRUE) |
istream& | ReadString(istream& str) |
static TString* | ReadString(TBuffer& b, const TClass* clReq) |
istream& | ReadToDelim(istream& str, char delim = \n) |
istream& | ReadToken(istream& str) |
TString& | Remove(Ssiz_t pos) |
TString& | Remove(Ssiz_t pos, Ssiz_t n) |
TString& | Remove(TString::EStripType s, char c) |
TString& | Replace(Ssiz_t pos, Ssiz_t n, const char* cs) |
TString& | Replace(Ssiz_t pos, Ssiz_t n, const TString& s) |
TString& | Replace(Ssiz_t pos, Ssiz_t n, const char* s, Ssiz_t ns) |
TString& | Replace(Ssiz_t pos, Ssiz_t n1, const TString& s, Ssiz_t n2) |
TString& | ReplaceAll(const TString& s1, const TString& s2) |
TString& | ReplaceAll(const TString& s1, const char* s2) |
TString& | ReplaceAll(const char* s1, const TString& s2) |
TString& | ReplaceAll(const char* s1, const char* s2) |
TString& | ReplaceAll(const char* s1, Ssiz_t ls1, const char* s2, Ssiz_t ls2) |
void | Resize(Ssiz_t n) |
static Ssiz_t | ResizeIncrement(Ssiz_t ri = 16) |
virtual void | ShowMembers(TMemberInspector& insp, char* parent) |
virtual Int_t | Sizeof() const |
virtual void | Streamer(TBuffer& b) |
void | StreamerNVirtual(TBuffer& b) |
TSubString | Strip(TString::EStripType s = kTrailing, char c = ) |
TSubString | Strip(TString::EStripType s = kTrailing, char c = ) const |
TSubString | SubString(const char* pat, Ssiz_t start = 0, TString::ECaseCompare cmp = kExact) |
TSubString | SubString(const char* pat, Ssiz_t start = 0, TString::ECaseCompare cmp = kExact) const |
TObjArray* | Tokenize(const TString& delim) const |
Bool_t | Tokenize(TString& tok, Ssiz_t& from, const char* delim = " ") const |
void | ToLower() |
void | ToUpper() |
static void | WriteString(TBuffer& b, const TString* a) |
Data Members
public:
enum EStripType { | kLeading | |
| kTrailing | |
| kBoth | |
}; | | |
enum ECaseCompare { | kExact | |
| kIgnoreCase | |
}; | | |
protected:
char* | fData | ref. counted data (TStringRef is in front) |
private:
static Ssiz_t | fgInitialCapac | Initial allocation Capacity |
static Ssiz_t | fgResizeInc | Resizing increment |
static Ssiz_t | fgFreeboard | Max empty space before reclaim |
TString(const char *cs)
Create TString and initialize it with string cs.
TString(const std::string &s)
Create TString and initialize it with string cs.
TString(const char *cs, Ssiz_t n)
Create TString and initialize it with the first n characters of cs.
void InitChar(char c)
Initialize a string with a single character.
~TString()
Delete a TString. I.e. decrease its reference count. When 0 free space.
Ssiz_t Capacity(Ssiz_t nc)
Return string capacity. If nc != current capacity Clone() the string
in a string with the desired capacity.
int CompareTo(const char *cs2, ECaseCompare cmp)
Compare a string to char *cs2.
int CompareTo(const TString &str, ECaseCompare cmp)
Compare a string to another string.
Ssiz_t Index(const char *pattern, Ssiz_t plen, Ssiz_t startIndex, ECaseCompare cmp)
Search for a string in the TString. Plen is the length of pattern,
startIndex is the index from which to start and cmp selects the type
of case-comparison.
TSubString Strip(EStripType st, char c)
Return a substring of self stripped at beginning and/or end.
TSubString Strip(EStripType st, char c)
Just use the "non-const" version, adjusting the return type.
void ToLower()
Change string to lower-case.
void ToUpper()
Change string to upper case.
TString(const char *a1, Ssiz_t n1, const char *a2, Ssiz_t n2)
Special constructor to initialize with the concatenation of a1 and a2.
void Clobber(Ssiz_t nc)
Clear string and make sure it has a capacity of nc.
void Clone()
Make string a distinct copy; preserve previous contents.
void Clone(Ssiz_t nc)
Make self a distinct copy with capacity of at least nc.
Preserve previous contents.
void ReadBuffer(char *&buffer)
Read string from I/O buffer.
Int_t Sizeof()
Returns size string will occupy on I/O buffer.
Ssiz_t MaxWaste(Ssiz_t mw)
Set maximum space that may be wasted in a string before doing a resize.
Default is 15.
TSubString SubString(const char *pattern, Ssiz_t startIndex, ECaseCompare cmp)
Returns a substring matching "pattern", or the null substring
if there is no such match. It would be nice if this could be yet another
overloaded version of operator(), but this would result in a type
conversion ambiguity with operator(Ssiz_t, Ssiz_t).
TSubString SubString(const char *pattern, Ssiz_t startIndex, ECaseCompare cmp)
Return sub-string matching pattern, starting at index. Cmp selects
the type of case conversion.
Bool_t IsAlpha()
Returns true if all characters in string are alphabetic.
Returns false in case string length is 0.
Bool_t IsAlnum()
Returns true if all characters in string are alphanumeric.
Returns false in case string length is 0.
Bool_t IsDigit()
Returns true if all characters in string are digits (0-9) or whitespaces,
i.e. "123456" and "123 456" are both valid integer strings.
Returns false in case string length is 0 or string contains other
characters or only whitespace.
Bool_t IsFloat()
Returns kTRUE if string contains a floating point or integer number.
Examples of valid formats are:
64320
64 320
6 4 3 2 0
6.4320 6,4320
6.43e20 6.43E20 6,43e20
6.43e-20 6.43E-20 6,43e-20
Bool_t IsHex()
Returns true if all characters in string are hexidecimal digits
(0-9,a-f,A-F). Returns false in case string length is 0.
Int_t Atoi()
Return integer value of string.
Valid strings include only digits and whitespace (see IsDigit()),
i.e. "123456", "123 456" and "1 2 3 4 56" are all valid
integer strings whose Atoi() value is 123456.
Long64_t Atoll()
Return long long value of string.
Valid strings include only digits and whitespace (see IsDigit()),
i.e. "123456", "123 456" and "1 2 3 4 56" are all valid
integer strings whose Atoll() value is 123456.
Double_t Atof()
Return floating-point value contained in string.
Examples of valid strings are:
64320
64 320
6 4 3 2 0
6.4320 6,4320
6.43e20 6.43E20 6,43e20
6.43e-20 6.43E-20 6,43e-20
Bool_t EndsWith(const char *s, ECaseCompare cmp)
Return true if string ends with the specified string.
TObjArray * Tokenize(const TString &delim)
This function is used to isolate sequential tokens in a TString.
These tokens are separated in the string by at least one of the
characters in delim. The returned array contains the tokens
as TObjString's. The returned array is the owner of the objects,
and must be deleted by the user.
void FormImp(const char *fmt, va_list ap)
Formats a string using a printf style format descriptor.
Existing string contents will be overwritten.
void Form(const char *va_(fmt), ...)
Formats a string using a printf style format descriptor.
Existing string contents will be overwritten.
TString Format(const char *va_(fmt), ...)
Static method which formats a string using a printf style format
descriptor and return a TString. Same as TString::From() but it is
not needed to first create a TString.
char * Data()
{ return (char*)(this+1); }
TString(const char *a1, Ssiz_t n1, const char *a2, Ssiz_t n2)
Special concatenation constructor
Author: Fons Rademakers 04/08/95
Last update: root/base:$Name: $:$Id: TString.cxx,v 1.58 2006/10/21 07:56:20 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.