library: libCore #include "TString.h" |
Inheritance Chart: | ||||||||||||||||
|
private:
void Clone() void Clone(Ssiz_t nc) protected:
TString(const char* a1, Ssiz_t n1, const char* a2, Ssiz_t n2) static Ssiz_t AdjustCapacity(Ssiz_t nc) void AssertElement(Ssiz_t nc) const void Clobber(Ssiz_t nc) void Cow() void Cow(Ssiz_t nc) void InitChar(char c) TStringRef* Pref() const public:
TString() TString(Ssiz_t ic) TString(const TString& s) TString(const char* s) TString(const char* s, Ssiz_t n) TString(const string& s) TString(char c) TString(char c, Ssiz_t s) TString(const TSubString& sub) TString Copy() const virtual ~TString() TString& Append(const char* cs) TString& Append(const char* cs, Ssiz_t n) TString& Append(const TString& s) TString& Append(const TString& s, Ssiz_t n) TString& Append(char c, Ssiz_t rep = 1) Double_t Atof() const Int_t Atoi() 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 char* s, TString::ECaseCompare cmp = kExact) const Bool_t Contains(const TString& pat, TString::ECaseCompare cmp = kExact) const Bool_t Contains(const TRegexp& pat) const Bool_t Contains(TPRegexp& pat) 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 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 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 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 Ssiz_t Index(const TRegexp& pat, Ssiz_t i = 0) const Ssiz_t Index(const TRegexp& pat, Ssiz_t* ext, Ssiz_t i = 0) const Ssiz_t Index(TPRegexp& pat, Ssiz_t i = 0) const Ssiz_t Index(TPRegexp& pat, Ssiz_t* ext, Ssiz_t i = 0) const static Ssiz_t InitialCapacity(Ssiz_t ic = 15) TString& Insert(Ssiz_t pos, const char* cs) TString& Insert(Ssiz_t pos, const char* cs, Ssiz_t n) TString& Insert(Ssiz_t pos, const TString& s) 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()(Ssiz_t start, Ssiz_t len) TSubString operator()(const TRegexp& re) TSubString operator()(const TRegexp& re, Ssiz_t start) TSubString operator()(TPRegexp& re) TSubString operator()(TPRegexp& re, Ssiz_t start) char operator()(Ssiz_t i) const TSubString operator()(Ssiz_t start, Ssiz_t len) const TSubString operator()(const TRegexp& re) const TSubString operator()(const TRegexp& re, Ssiz_t start) const TSubString operator()(TPRegexp& re) 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 char* cs, Ssiz_t n) TString& Prepend(const TString& s) 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) static TString* ReadString(TBuffer& b, const TClass* clReq) istream& ReadString(istream& str) 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 char* s, Ssiz_t ns) TString& Replace(Ssiz_t pos, Ssiz_t n, const TString& s) 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 void ToLower() void ToUpper() static void WriteString(TBuffer& b, const TString* a)
private:
static Ssiz_t fgInitialCapac Initial allocation Capacity static Ssiz_t fgResizeInc Resizing increment static Ssiz_t fgFreeboard Max empty space before reclaim protected:
char* fData ref. counted data (TStringRef is in front) public:
static const TString::EStripType kLeading static const TString::EStripType kTrailing static const TString::EStripType kBoth static const TString::ECaseCompare kExact static const TString::ECaseCompare kIgnoreCase
TString Basic string class. Cannot be stored in a TCollection... use TObjString instead.
Create TString and initialize it with the first n characters of cs.
Return string capacity. If nc != current capacity Clone() the string in a string with the desired capacity.
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.
Remove at most n1 characters from self beginning at pos, and replace them with the first n2 characters of cs.
Find & Replace ls1 symbols of s1 with ls2 symbols of s2 if any.
Remove char c at begin and/or end of string (like Strip() but modifies directly the string.
Return a substring of self stripped at beginning and/or end.
Just use the "non-const" version, adjusting the return type.
Special constructor to initialize with the concatenation of a1 and a2.
Make self a distinct copy with capacity of at least nc. Preserve previous contents.
Read TString object from buffer. Simplified version of TBuffer::ReadObject (does not keep track of multiple references to same string). We need to have it here because TBuffer::ReadObject can only handle descendant of TObject.
Write TString object to buffer. Simplified version of TBuffer::WriteObject (does not keep track of multiple references to the same string). We need to have it here because TBuffer::ReadObject can only handle descendant of TObject
Set maximum space that may be wasted in a string before doing a resize. Default is 15.
Return sub-string of string starting at start with length len.
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).
Return sub-string of string starting at start with length len.
Return sub-string matching pattern, starting at index. Cmp selects the type of case conversion.
Returns true if all characters in string are alphabetic. Returns false in case string length is 0.
Returns true if all characters in string are alphanumeric. Returns false in case string length is 0.
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.
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
Returns true if all characters in string are hexidecimal digits (0-9,a-f,A-F). Returns false in case string length is 0.
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.
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
Return true if string ends with the specified string.
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.
Formats a string using a printf style format descriptor. Existing string contents will be overwritten.