zeus::TString Class Reference

#include <String.h>

Inheritance diagram for zeus::TString:

zeus::IString zeus::IValueType

List of all members.

Public Member Functions

 TString ()
 TString (const wchar_t *data)
 TString (const char *data)
 TString (wchar_t wcChar, Uint uiCount=1)
 TString (char cChar, Uint uiCount=1)
 TString (const TString &strString)
 TString (const IString &strString)
 TString (const IString *pString)
 TString (Int32 lValue)
 TString (Int64 ldValue)
 TString (int iValue)
 TString (Uint32 ulValue)
 TString (Uint64 uldValue)
 TString (unsigned int uiValue)
 TString (Float fValue)
 TString (Float fValue, Uint uiDigits)
 TString (bool bValue)
virtual ~TString ()
TStringoperator= (const TString &rInstr)
TStringoperator= (const IString &rInstr)
TStringoperator= (const IString *pInstr)
TStringoperator= (const wchar_t *pData)
TStringoperator= (const Int iData)
TStringoperator= (const int iData)
TStringoperator= (const Uint uiData)
TStringoperator= (const unsigned int uiData)
TStringoperator= (const Float fData)
TStringoperator= (const char *pData)
TStringoperator= (bool bData)
bool operator== (const TString &rInstr) const
bool operator== (const IString &rInstr) const
bool operator== (const IString *pInstr) const
bool operator== (const wchar_t *pInbuffer) const
bool operator== (const char *pInbuffer) const
bool operator== (const Float fData) const
bool operator== (const Int iData) const
bool operator== (const int iData) const
bool operator== (const Uint uiData) const
bool operator== (const unsigned int uiData) const
bool operator== (bool bData) const
TString operator+ (const TString &rInstr) const
TString operator+ (const IString &rInstr) const
TString operator+ (const wchar_t *pInbuffer) const
TString operator+ (const char *pInbuffer) const
TString operator+ (const Int iInval) const
TString operator+ (const int iInval) const
TString operator+ (const Uint uiInval) const
TString operator+ (const unsigned int uiInval) const
TString operator+ (const Float fInval) const
bool operator!= (const TString &rInstr) const
bool operator!= (const IString &rInstr) const
bool operator!= (const IString *pInstr) const
bool operator!= (const wchar_t *pInbuffer) const
bool operator!= (const char *pInbuffer) const
bool operator!= (const Float fData) const
bool operator!= (const Int iData) const
bool operator!= (const int iData) const
bool operator!= (const Uint uiData) const
bool operator!= (const unsigned int uiData) const
bool operator!= (const bool bData) const
TStringoperator+= (const TString &rInstr)
TStringoperator+= (const IString &rInstr)
TStringoperator+= (const wchar_t *pInbuffer)
TStringoperator+= (const char *pInbuffer)
TStringoperator+= (const Int iInval)
TStringoperator+= (const int iInval)
TStringoperator+= (const Uint uiInval)
TStringoperator+= (const unsigned int uiInval)
TStringoperator+= (const Float fInval)
wchar_t & operator[] (Int iIndex)
bool operator< (const TString &rInStr) const
bool operator<= (const TString &rInStr) const
bool operator> (const TString &rInStr) const
bool operator>= (const TString &rInStr) const
bool containsChar (const wchar_t wcChar) const
bool containsCharOf (const wchar_t *wcChars) const
Int getFirstPosOf (const wchar_t *wcChars) const
Int indexOf (wchar_t wcChar) const
TString deleteSubString (Int iStartIndex, Int iEndIndex=LONG_MAX) const
TString getSubString (Int iStartIndex, Int iEndIndex=LONG_MAX) const
TString getLeft (Int iCharCount) const
TString getRight (Int iCharCount) const
TString deleteLeft (Int iCharCount) const
TString deleteRight (Int iCharCount) const
Int getSubStringCount (const IString &rSubstring) const
TString insert (Int iIndex, const IString &rStrToInsert) const
TString insert (Int iIndex, const TString &rStrToInsert) const
TString remove (const IString &rToRemove, Int *pReplaces=NULL) const
TString remove (const TString &strToRemove, Int *pReplaces=NULL) const
TString removeFirst (const IString &rToRemove) const
TString removeFirst (const TString &rToRemove) const
TString replace (const IString &rToRemove, const IString &rReplace, Int *pReplaces=NULL) const
TString replace (const TString &rToRemove, const TString &rReplace, Int *pReplaces=NULL) const
TString replaceFirst (const IString &rToRemove, const IString &rReplace) const
TString replaceFirst (const TString &rToRemove, const TString &rReplace) const
TString toUpperCase () const
TString toLowerCase () const
TString trim () const
TString trimLeft () const
TString trimRight () const
TString terminated (const IString &rTermination) const
TString terminated (const TString &rTermination) const
TString enclosed (const IString &rEnclosure) const
TString enclosed (const TString &rEnclosure) const
TString enquoted () const
Int64 getHash () const
virtual const wchar_t *MQUALIFIER c_bstr () const
virtual const char *MQUALIFIER c_str (bool *pError) const
virtual Float MQUALIFIER toFloat (Float fPredef=0.0, bool *pbError=NULL) const
virtual Int MQUALIFIER toInt (Int iPredef=0, bool *pbError=NULL) const
virtual Uint MQUALIFIER toUint (Uint uiPredef=0, bool *pbError=NULL) const
virtual Timeval MQUALIFIER toTimeval (Timeval tmPredef=0, bool *pbError=NULL) const
virtual bool MQUALIFIER toBool (bool bPredef=false, bool *pbError=NULL) const
virtual bool MQUALIFIER isFloat () const
virtual bool MQUALIFIER isInt () const
virtual bool MQUALIFIER isBool () const
virtual bool MQUALIFIER equals (const wchar_t *pInbuffer, bool bIgnoreCase=false) const
virtual bool MQUALIFIER equalsStr (const IString &rInstr, bool bIgnoreCase=false) const
virtual void MQUALIFIER concat (const wchar_t *pInbuffer)
virtual void MQUALIFIER concatStr (const IString &rInstr)
virtual void MQUALIFIER assign (const wchar_t *pInbuffer)
virtual void MQUALIFIER assignStr (const IString &rInstr)
virtual Int MQUALIFIER getSize () const
virtual wchar_t MQUALIFIER getChar (Int iIndex) const
virtual Int MQUALIFIER getFirstPos (const wchar_t *pSubBuffer) const
virtual Int MQUALIFIER getFirstPosStr (const IString &rSubString) const
virtual Int MQUALIFIER getLastPos (const wchar_t *pSubBuffer) const
virtual Int MQUALIFIER getLastPosStr (const IString &rSubString) const
virtual void MQUALIFIER clear ()
virtual bool MQUALIFIER isEmpty () const
virtual bool MQUALIFIER endsWith (const wchar_t *pString) const
virtual bool MQUALIFIER endsWithStr (const IString &rString) const
virtual bool MQUALIFIER startsWith (const wchar_t *pString) const
virtual bool MQUALIFIER startsWithStr (const IString &rString) const
virtual Int MQUALIFIER compareTo (const IString &rString) const
virtual bool MQUALIFIER contains (const wchar_t *pSubString) const
virtual bool MQUALIFIER containsStr (const IString &rSubString) const

Static Public Member Functions

static TString formatFloat (Float fValue, Float fRoundPrecision=0, Uint uiTailingZeros=0, Uint uiLeadingZeros=1)
static TString formatInt (Int iValue, Uint uiLeadingZeros)
static TString format (const char *pcFormat,...)
static TString format (const wchar_t *pwcFormat,...)
static TString format (const IString &rFormat,...)
static TString formatV (const char *pcFormat, va_list Arg)
static TString formatV (const wchar_t *pwcFormat, va_list Arg)
static TString formatV (const IString &rFormat, va_list Arg)
static TString transcode (const IByteArray &list)
static TByteArray transcode (const TString &rValue, bool bAsWideChar)
static TByteArray transcode (const IString &rValue, bool bAsWideChar)
static TString trimExt (const IString &rSource, const IString &rChars, bool bLeft=true, bool bRight=true)

Static Protected Member Functions

static TString convertDouble (const Float &rfValue, Int iDigit=15)


Detailed Description

This is the implementation of the Zeus String. The Zeus String is a null terminated wide string array (16bit or 32bit depending on the platform). The last character of the string is the NULL-character which is used to mark the end of the string.
There are different methods for convertions such as number, float and 8bit array convertions.
The string class is a stack type and implements the IString-interface. This interface is used to define other interface methods having string parameters.

Constructor & Destructor Documentation

zeus::TString::TString (  )  [inline]

Creates an empty string

zeus::TString::TString ( const wchar_t *  pData  )  [inline]

Creates a string out of a wide char array. The array must be NULL terminated

Parameters:
pData : wide array containing the data

TString::TString ( const char *  pData  ) 

Creates a string out of a regular char array. The array must be NULL terminated

Parameters:
pData : char array containing the data

TString::TString ( wchar_t  wcChar,
Uint  uiCount = 1 
)

Creates a string with n-wide characters

Parameters:
wcChar : wide character
uiCount : number of repetitions

TString::TString ( char  cChar,
Uint  uiCount = 1 
)

Creates a string with n-characters

Parameters:
cChar : Character
uiCount : number of repetitions

zeus::TString::TString ( const TString rString  )  [inline]

Copy constructor

Parameters:
rString : string to copy

zeus::TString::TString ( const IString rString  )  [inline]

Creates a string out of an other string by interface.

Parameters:
rString : string to copy

TString::TString ( const IString pString  ) 

Konstruktor.

Parameters:
pString : String Objekt. Die Daten werden in das neue Objekt kopiert.

TString::TString ( Int32  lValue  ) 

Creates a new string out of a int32 value.

Parameters:
lValue : int32 value

TString::TString ( Int64  ldValue  ) 

Creates a new string out of a int64 value.

Parameters:
lValue : int32 value

TString::TString ( int  iValue  ) 

Creates a new string out of a int value.

Parameters:
iValue : int value

TString::TString ( Uint32  ulValue  ) 

Creates a new string out of a unsigned int32 value.

Parameters:
ulValue : Uint32 value

TString::TString ( Uint64  uldValue  ) 

Creates a new string out of a unsigned long 64 value.

Parameters:
uldValue : unsigned long 64 value

TString::TString ( unsigned int  uiValue  ) 

Creates a new string out of a unsigned int value.

Parameters:
uiValue : unsigned int value

TString::TString ( Float  fValue  ) 

Konstruktor.

Parameters:
fValue : float value

TString::TString ( Float  fValue,
Uint  uiDigits 
)

Konstruktor.

Parameters:
fValue : double value
uiDigits : Digits to convert

TString::TString ( bool  bValue  ) 

Konstruktor.

Parameters:
bValue : boolean value

virtual zeus::TString::~TString (  )  [inline, virtual]

Destroys the string and its arrays


Member Function Documentation

TString TString::formatFloat ( Float  fValue,
Float  fRoundPrecision = 0,
Uint  uiTailingZeros = 0,
Uint  uiLeadingZeros = 1 
) [static]

Converts a float value into a string value using a special format

See also:
TFloat::format

TString TString::formatInt ( Int  iValue,
Uint  uiLeadingZeros 
) [static]

Converts a int value into a string value using a special format

See also:
TFloat::format

TString zeus::TString::format ( const char *  pcFormat,
  ... 
) [inline, static]

sets a formated string using the standard C formatting of string. See also std::sprintf and std::wsprintf

TString zeus::TString::format ( const wchar_t *  pwcFormat,
  ... 
) [inline, static]

sets a formated string using the standard C formatting of string. See also std::sprintf and std::wsprintf

TString zeus::TString::format ( const IString rFormat,
  ... 
) [inline, static]

sets a formated string using the standard C formatting of string. See also std::sprintf and std::wsprintf

TString TString::formatV ( const char *  pcFormat,
va_list  Arg 
) [static]

sets a formated string using the standard C formatting of string. See also std::vsprintf and std::vwsprintf

TString TString::formatV ( const wchar_t *  pwcFormat,
va_list  Arg 
) [static]

sets a formated string using the standard C formatting of string. See also std::vsprintf and std::vwsprintf

TString TString::formatV ( const IString rFormat,
va_list  Arg 
) [static]

sets a formated string using the standard C formatting of string. See also std::vsprintf and std::vwsprintf

TString TString::transcode ( const IByteArray rList  )  [static]

Converts a array of bytes to a string

Parameters:
rList : Byte array to convert into a string
Returns:
Converted string data
Note:
The byte array might contain simple character data or 16bit UNICODE data. If UNICODE data is stored the header 0xFFFE is needed (1st and 2nd byte).

TByteArray zeus::TString::transcode ( const TString rValue,
bool  bAsWideChar 
) [inline, static]

Converts a string into a array of bytes

TByteArray TString::transcode ( const IString rValue,
bool  bAsWideChar 
) [static]

Converts a string into a array of bytes

Parameters:
rValue : String value to convert into a byte array
bAsWideChar : Flag if the byte array will represent the ISO or UNICODE data of the string. True means UNICODE.
Returns:
Byte array
Note:
The TString::transcode() method does only support the 2 Byte data of UNICODE. This will convert the wchar_t-Data if the sizeof(wchar_t) is bigger than 2 Bytes.

TString TString::trimExt ( const IString rSource,
const IString rChars,
bool  bLeft = true,
bool  bRight = true 
) [static]

This method trims the string. All leading or ending characters listed in parameter rChars are removed

Parameters:
rSource : Source string
rChars : List of characters to remove
bLeft : Flag if the left side must be trimmed
bRight : Flag if the right side must be trimmed
Returns:
trimmed string

TString & zeus::TString::operator= ( const TString rInstr  )  [inline]

Copy operator. An other string is copied into this string object

Parameters:
rInstr : object to copy

TString & zeus::TString::operator= ( const IString rInstr  )  [inline]

Copy operator. An other string is copied into this string object

Parameters:
rInstr : object to copy

TString & zeus::TString::operator= ( const IString pInstr  )  [inline]

Assignment operator. Another string is copied into this string object

Parameters:
pInstr : Pointer to object to assign

TString & zeus::TString::operator= ( const wchar_t *  pData  )  [inline]

Copy operator. A wide array is copied into this string object

Parameters:
pData : wide array to copy

TString & zeus::TString::operator= ( const Int  iData  )  [inline]

This assigns a int value to the string object

Parameters:
iData : Value to assign

TString & zeus::TString::operator= ( const int  iData  )  [inline]

This assigns a int value to the string object

Parameters:
iData : Value to assign

TString & zeus::TString::operator= ( const Uint  uiData  )  [inline]

This assigns a unsigned int value to the string object

Parameters:
uiData : Value to assign

TString & zeus::TString::operator= ( const unsigned int  uiData  )  [inline]

This assigns a unsigned int value to the string object

Parameters:
uiData : Value to assign

TString & zeus::TString::operator= ( const Float  fData  )  [inline]

This assigns a float value to the string object

Parameters:
fData : Value to assign

TString & zeus::TString::operator= ( const char *  pData  )  [inline]

This assigns a 8bit array to the string object

Parameters:
pData : array to assign

TString & zeus::TString::operator= ( bool  bData  )  [inline]

This assigns a boolean value to the string object

Parameters:
bData : boolean value to assign

bool zeus::TString::operator== ( const TString rInstr  )  const [inline]

Vergleichsoperator. Der wchar_t-Array wird mit dem des Objekts verglichen.

Parameters:
rInstr : zu vergleichendes Stringobjekt

bool zeus::TString::operator== ( const IString rInstr  )  const [inline]

Vergleichsoperator. Der wchar_t-Array wird mit dem des Objekts verglichen.

Parameters:
rInstr : zu vergleichendes Stringobjekt

bool zeus::TString::operator== ( const IString pInstr  )  const [inline]

Vergleichsoperator fuer IString*.

Parameters:
pInstr : Zeiger auf zu vergleichendes Stringobjekt

bool zeus::TString::operator== ( const wchar_t *  pInbuffer  )  const [inline]

Vergleichsoperator. Der wchar_t-Array wird mit dem des Objekts verglichen.

Parameters:
pInbuffer : zu vergleichendes Stringobjekt

bool zeus::TString::operator== ( const char *  inbuffer  )  const [inline]

Vergleichsoperator. Der char-Array wird mit dem des Objekts verglichen.

Parameters:
inbuffer : zu vergleichendes Stringobjekt

bool zeus::TString::operator== ( const Float  fData  )  const [inline]

Vergleichsoperator: Der einen double Wert mit dem String vergleicht

Parameters:
fData : Zuweisungsparameter

bool zeus::TString::operator== ( const Int  iData  )  const [inline]

equals operator check if the string is equal to an int

Parameters:
iData : value to check

bool zeus::TString::operator== ( const int  iData  )  const [inline]

equals operator check if the string is equal to an int

Parameters:
iData : value to check

bool zeus::TString::operator== ( const Uint  uiData  )  const [inline]

equals operator check if the string is equal to an unsigned int

Parameters:
uiData : value to check

bool zeus::TString::operator== ( const unsigned int  uiData  )  const [inline]

equals operator check if the string is equal to an unsigned int

Parameters:
uiData : value to check

bool zeus::TString::operator== ( bool  bData  )  const [inline]

Check the equality to a boolean value.

Parameters:
bData : boolean value for comparison.

TString zeus::TString::operator+ ( const TString rInstr  )  const [inline]

Hinzufuegen eines Strings

Parameters:
rInstr : Stringobjekt

TString zeus::TString::operator+ ( const IString rInstr  )  const [inline]

Hinzufuegen eines Strings

Parameters:
rInstr : Stringobjekt

TString zeus::TString::operator+ ( const wchar_t *  pInbuffer  )  const [inline]

Hinzufuegen eines wchar_t-Arrays

Parameters:
pInbuffer : wchar_t Buffer welcher hinzugefuegt wird

TString zeus::TString::operator+ ( const char *  pInbuffer  )  const [inline]

Hinzufuegen eines char-Arrays

Parameters:
pInbuffer : char Buffer welcher hinzugefuegt wird

TString zeus::TString::operator+ ( const Int  iInval  )  const [inline]

adds an int value to the string

Parameters:
iInval : Value to add

TString zeus::TString::operator+ ( const int  iInval  )  const [inline]

adds an int value to the string

Parameters:
iInval : Value to add

TString zeus::TString::operator+ ( const Uint  uiInval  )  const [inline]

adds an unsigned int value to the string

Parameters:
uiInval : Value to add

TString zeus::TString::operator+ ( const unsigned int  uiInval  )  const [inline]

adds an unsigned int value to the string

Parameters:
uiInval : Value to add

TString zeus::TString::operator+ ( const Float  fInval  )  const [inline]

Hinzufuegen eines float-Values

Parameters:
fInval : float-Value

bool zeus::TString::operator!= ( const TString rInstr  )  const [inline]

Vergleichsoperator. Der wchar_t-Array wird mit dem des Objekts verglichen.

Parameters:
rInstr : zu vergleichendes Stringobjekt

bool zeus::TString::operator!= ( const IString rInstr  )  const [inline]

Vergleichsoperator. Der wchar_t-Array wird mit dem des Objekts verglichen.

Parameters:
rInstr : zu vergleichendes Stringobjekt

bool zeus::TString::operator!= ( const IString pInstr  )  const [inline]

Vergleichsoperator fuer IString*.

Parameters:
pInstr : Zeiger auf zu vergleichendes Stringobjekt

bool zeus::TString::operator!= ( const wchar_t *  pInbuffer  )  const [inline]

Vergleichsoperator. Der wchar_t-Array wird mit dem des Objekts verglichen.

Parameters:
pInbuffer : zu vergleichendes Stringobjekt

bool zeus::TString::operator!= ( const char *  pInbuffer  )  const [inline]

Vergleichsoperator. Der char-Array wird mit dem des Objekts verglichen.

Parameters:
pInbuffer : zu vergleichendes Stringobjekt

bool zeus::TString::operator!= ( const Float  fData  )  const [inline]

Vergleichsoperator: Der einen float Wert mit dem String vergleicht

Parameters:
fData : Zuweisungsparameter

bool zeus::TString::operator!= ( const Int  iData  )  const [inline]

Checks if the string is not equal to an int value

Parameters:
iData : value to check

bool zeus::TString::operator!= ( const int  iData  )  const [inline]

Checks if the string is not equal to an int value

Parameters:
iData : value to check

bool zeus::TString::operator!= ( const Uint  uiData  )  const [inline]

Checks if the string is not equal to an unsigned int value

Parameters:
uiData : value to check

bool zeus::TString::operator!= ( const unsigned int  uiData  )  const [inline]

Checks if the string is not equal to an unsigned int value

Parameters:
uiData : value to check

bool zeus::TString::operator!= ( const bool  bData  )  const [inline]

Negation of operator==. /*

TString & zeus::TString::operator+= ( const TString rInstr  )  [inline]

Concats a string with an other string

Parameters:
rInstr : string to concatenate
Returns:
this

TString & zeus::TString::operator+= ( const IString rInstr  )  [inline]

Concats a string with an other string

Parameters:
rInstr : string to concatenate
Returns:
this

TString & zeus::TString::operator+= ( const wchar_t *  pInbuffer  )  [inline]

Concats a string with a wide char buffer

Parameters:
pInbuffer : buffer
Returns:
this

TString & zeus::TString::operator+= ( const char *  pInbuffer  )  [inline]

Concats a string with a char buffer

Parameters:
pInbuffer : buffer
Returns:
this

TString & zeus::TString::operator+= ( const Int  iInval  )  [inline]

Concats a string with a int value

Parameters:
iInval : value
Returns:
this

TString & zeus::TString::operator+= ( const int  iInval  )  [inline]

Concats a string with a int value

Parameters:
iInval : value
Returns:
this

TString & zeus::TString::operator+= ( const Uint  uiInval  )  [inline]

Concats a string with a unsigned Int value

Parameters:
iInval : value
Returns:
this

TString & zeus::TString::operator+= ( const unsigned int  uiInval  )  [inline]

Concats a string with a unsigned int value

Parameters:
iInval : value
Returns:
this

TString & zeus::TString::operator+= ( const Float  fInval  )  [inline]

Concats a string with a float value

Parameters:
fInval : value
Returns:
this

wchar_t & zeus::TString::operator[] ( Int  iIndex  )  [inline]

Klammeroperator: Zugriff auf ein bestimmtes Character im String

Parameters:
index : Zuweisungsparameter
Returns:
character an dieser Position

bool zeus::TString::operator< ( const TString rInStr  )  const [inline]

compares lexicographically two strings and returns true if the this is smaller than the parameter rInStr.

Parameters:
rInStr : String to compare
Return values:
true : this is smaller
false : else

bool zeus::TString::operator<= ( const TString rInStr  )  const [inline]

compares lexicographically two strings and returns true if the this is smaller than or equals the parameter rInStr.

Parameters:
rInStr : String to compare
Return values:
true : this is smaller or equal
false : else

bool zeus::TString::operator> ( const TString rInStr  )  const [inline]

compares lexicographically two strings and returns true if the this is bigger than the parameter rInStr.

Parameters:
rInStr : String to compare
Return values:
true : this is bigger
false : else

bool zeus::TString::operator>= ( const TString rInStr  )  const [inline]

compares lexicographically two strings and returns true if the this is bigger than or equals the parameter rInStr.

Parameters:
rInStr : String to compare
Return values:
true : this is bigger or equal
false : else

bool zeus::TString::containsChar ( const wchar_t  wcChar  )  const [inline]

Checks if a char is contained by the string

Parameters:
wcChar : Char to check
Return values:
true : char found
false,: No such char found

bool TString::containsCharOf ( const wchar_t *  wcChars  )  const

Checks if a char of an array of chars is contained by the string. Special case is handled if the set of chars is empty. The empty set is always a part of each set.

Parameters:
wcChars : array of chars to check (null terminated)
Return values:
true : char found
false,: No such char found

Int TString::getFirstPosOf ( const wchar_t *  wcChars  )  const

Get the first position for a set of characters.

Parameters:
wcChars [IN]: Set of chars to be searched for.
Return values:
: Position index of the first character found.

Int TString::indexOf ( wchar_t  wcChar  )  const

Returns the position index of a character inside the string

TString TString::deleteSubString ( Int  iStartIndex,
Int  iEndIndex = LONG_MAX 
) const

returns the result of a substring remove.

Parameters:
iStartIndex : Start index
iEndIndex : end index
Returns:
new string

TString TString::getSubString ( Int  iStartIndex,
Int  iEndIndex = LONG_MAX 
) const

Ermitteln des Substring

Parameters:
iStartIndex : Start index
iEndIndex : end index
Returns:
substring

TString zeus::TString::getLeft ( Int  iCharCount  )  const [inline]

This method returns the left substring (begins at index 0 to index iCharCount -1

See also:
TString::getSubString

TString zeus::TString::getRight ( Int  iCharCount  )  const [inline]

This method returns the right substring (begins at index size- iCharCount to size-1

See also:
TString::getSubString

TString zeus::TString::deleteLeft ( Int  iCharCount  )  const [inline]

This method deletes the left substring (begins at index 0 to index iCharCount -1

See also:
TString::deleteSubString

TString zeus::TString::deleteRight ( Int  iCharCount  )  const [inline]

This method deletes the right substring (begins at index size - ulCharCount to size-1

See also:
TString::deleteSubString

Int TString::getSubStringCount ( const IString rSubstring  )  const

This method counts the substrings of this string

Parameters:
strSubstring : Substring
Returns:
number of times this substring occures in this string

TString TString::insert ( Int  iIndex,
const IString rStrToInsert 
) const

inserts a string at the position index and returns the new string

Parameters:
iIndex : position index to insert the string
rStrToInsert : String to insert
Returns:
new string

TString zeus::TString::insert ( Int  iIndex,
const TString rStrToInsert 
) const [inline]

inserts a string at the position index and returns the new string

Parameters:
lIndex : position index to insert the string
rStrToInsert : String to insert
Returns:
new string

TString zeus::TString::remove ( const IString rToRemove,
Int *  pReplaces = NULL 
) const [inline]

This method removes all substrings from this string and returns the new string

Parameters:
rToRemove : Substring to remove
pReplaces : If pointer is valid, the number of replaces are returned
Returns:
new string

TString zeus::TString::remove ( const TString rToRemove,
Int *  pReplaces = NULL 
) const [inline]

This method removes all substrings from this string and returns the new string

Parameters:
rToRemove : Substring to remove
pReplaces : If pointer is valid, the number of replaces are returned
Returns:
new string

TString zeus::TString::removeFirst ( const IString rToRemove  )  const [inline]

This method removes the first substrings found from this string and returns the new string

Parameters:
rToRemove : Substring to remove
Returns:
new string

TString zeus::TString::removeFirst ( const TString rToRemove  )  const [inline]

This method removes the first substrings found from this string and returns the new string

Parameters:
rToRemove : Substring to remove
Returns:
new string

TString TString::replace ( const IString rToRemove,
const IString rReplace,
Int *  pReplaces = NULL 
) const

This method works like replace() but it will replace all substrings inside this string.

Parameters:
rToRemove : Substring to remove
rReplace : String for replacing
pReplaces : If pointer is valid, the number of replaces are returned
Returns:
new string

TString zeus::TString::replace ( const TString rToRemove,
const TString rReplace,
Int *  pReplaces = NULL 
) const [inline]

This method works like replace() but it will replace all substrings inside this string.

Parameters:
rToRemove : Substring to remove
strReplace : String for replacing
pReplaces : If pointer is valid, the number of replaces are returned
Returns:
new string

TString TString::replaceFirst ( const IString rToRemove,
const IString rReplace 
) const

This method replaces a substring with a new string. It can also be used just for removing a substring by calling this method with an empty strReplace variable.

Parameters:
rToRemove : Substring to remove
rReplace : String for replaceing
Returns:
new string

TString zeus::TString::replaceFirst ( const TString rToRemove,
const TString rReplace 
) const [inline]

This method replaces the first substring with a new string. It might be used just for removing a substring by calling this method with an empty strReplace variable.

Parameters:
rToRemove : Substring to remove
rReplace : String for replaceing
Returns:
new string

TString TString::toUpperCase (  )  const

Converts the string content to upper case letters

Returns:
converted string

TString TString::toLowerCase (  )  const

Converts the string content to lower case letters

Returns:
converted string

TString zeus::TString::trim (  )  const [inline]

This method trims the string. All leading or ending white spaces are removed.

Returns:
trimmed string

TString zeus::TString::trimLeft (  )  const [inline]

This method trims the string. All leading white spaces are removed.

Returns:
trimmed string

TString zeus::TString::trimRight (  )  const [inline]

This method trims the string. All ending white spaces are removed.

Returns:
trimmed string

TString zeus::TString::terminated ( const IString rTermination  )  const [inline]

Returns a string terminated by strTermination, but does not add the termination if it already exists.

Parameters:
rTermination : String must end with this substring
Returns:
new string

TString zeus::TString::terminated ( const TString rTermination  )  const [inline]

Overload the method terminated() for TString.

TString zeus::TString::enclosed ( const IString rEnclosure  )  const [inline]

Returns a string enclosed by rEnclosure, but does not add the enclosure wherever it already exists.

Parameters:
rEnclosure : String must start and end with this substring
Returns:
new string

TString zeus::TString::enclosed ( const TString rEnclosure  )  const [inline]

Overload the method enclosed() for TString.

TString zeus::TString::enquoted (  )  const [inline]

Returns a string enquoted by ", but does not add the quotes wherever they already exist.

Returns:
new string

Int64 TString::getHash (  )  const

This method returns the hash of the unicode string

const wchar_t *MQUALIFIER zeus::TString::c_bstr (  )  const [inline, virtual]

See also:
IString::c_bstr

Implements zeus::IString.

const char *MQUALIFIER zeus::TString::c_str ( bool *  pError  )  const [inline, virtual]

See also:
IString::c_str

Implements zeus::IString.

Float MQUALIFIER TString::toFloat ( Float  fPredef = 0.0,
bool *  pbError = NULL 
) const [virtual]

See also:
IString::toFloat

Int MQUALIFIER TString::toInt ( Int  iPredef = 0,
bool *  pbError = NULL 
) const [virtual]

See also:
IString::toInt

Uint MQUALIFIER TString::toUint ( Uint  uiPredef = 0,
bool *  pbError = NULL 
) const [virtual]

See also:
IString::toUint

Implements zeus::IString.

Timeval MQUALIFIER TString::toTimeval ( Timeval  tmPredef = 0,
bool *  pbError = NULL 
) const [virtual]

See also:
IString::toTimeval

Implements zeus::IString.

bool MQUALIFIER TString::toBool ( bool  bPredef = false,
bool *  pbError = NULL 
) const [virtual]

See also:
IString::toBool

Implements zeus::IString.

bool MQUALIFIER zeus::TString::isFloat (  )  const [inline, virtual]

See also:
IString::isFloat

Implements zeus::IString.

bool MQUALIFIER zeus::TString::isInt (  )  const [inline, virtual]

See also:
IString::isInt

Implements zeus::IString.

bool MQUALIFIER zeus::TString::isBool (  )  const [inline, virtual]

See also:
IString::isBool

Implements zeus::IString.

bool MQUALIFIER TString::equals ( const wchar_t *  pInbuffer,
bool  bIgnoreCase = false 
) const [virtual]

See also:
IString::equals

Implements zeus::IString.

bool MQUALIFIER zeus::TString::equalsStr ( const IString rInstr,
bool  bIgnoreCase = false 
) const [inline, virtual]

See also:
IString::equalsStr

Implements zeus::IString.

void MQUALIFIER TString::concat ( const wchar_t *  pInbuffer  )  [virtual]

See also:
IString::concat

Implements zeus::IString.

void MQUALIFIER zeus::TString::concatStr ( const IString rInstr  )  [inline, virtual]

See also:
IString::concatStr

Implements zeus::IString.

void MQUALIFIER TString::assign ( const wchar_t *  pInbuffer  )  [virtual]

See also:
IString::assign

Implements zeus::IString.

void MQUALIFIER zeus::TString::assignStr ( const IString rInstr  )  [inline, virtual]

See also:
IString::assignStr

Implements zeus::IString.

Int MQUALIFIER zeus::TString::getSize (  )  const [inline, virtual]

See also:
IString::getSize

Implements zeus::IString.

wchar_t MQUALIFIER zeus::TString::getChar ( Int  iIndex  )  const [inline, virtual]

See also:
IString::getChar

Implements zeus::IString.

Int MQUALIFIER TString::getFirstPos ( const wchar_t *  pSubBuffer  )  const [virtual]

Die Suche nach dem SubString wurde nach dem Knuth-Morris-Pratt Verfahren implementiert. In einem Preprocessing-Verfahren wird aus dem gesuchten SubString eine Sprungtabelle erstellt. Je nach dem, wieviele Zeichen bei der Suche uebereinstimmten, kann direkt eine bestimmte Distanz gesprungen werden, falls das darauffolgende Zeichen nicht uebereinstimmt.

Preprocessing Algorithmus:
Initialisiere die Tabelle mit Sprungweite 1
Initialisiere die Vergleichsvariable k mit 0
Wiederhole solange bis Ende des SubStrings erreicht

  • Falls das Zeichen[i] ungleich Zeichen[k] ist dann Setze die Sprungweite[i+1] = i+1
  • Sonst setze Sprungweite[i+1] = Sprungweite[i] und wenn i groesser als 0 ist dann inkrementiere k um eins

    See also:
    IString::getFirstPos

Implements zeus::IString.

Int MQUALIFIER zeus::TString::getFirstPosStr ( const IString rSubString  )  const [inline, virtual]

See also:
IString::getFirstPosStr

Implements zeus::IString.

Int MQUALIFIER TString::getLastPos ( const wchar_t *  pSubBuffer  )  const [virtual]

See also:
IString::getLastPos

Implements zeus::IString.

Int MQUALIFIER zeus::TString::getLastPosStr ( const IString rSubString  )  const [inline, virtual]

See also:
IString::getLastPosStr

Implements zeus::IString.

void MQUALIFIER zeus::TString::clear (  )  [inline, virtual]

See also:
IString::clear

Implements zeus::IString.

bool MQUALIFIER zeus::TString::isEmpty (  )  const [inline, virtual]

See also:
IString::isEmpty

Implements zeus::IString.

bool MQUALIFIER zeus::TString::endsWith ( const wchar_t *  pString  )  const [inline, virtual]

See also:
IString::endsWith

Implements zeus::IString.

bool MQUALIFIER TString::endsWithStr ( const IString rString  )  const [virtual]

See also:
IString::endsWithStr

Implements zeus::IString.

bool MQUALIFIER zeus::TString::startsWith ( const wchar_t *  pString  )  const [inline, virtual]

See also:
IString::startsWith

Implements zeus::IString.

bool MQUALIFIER TString::startsWithStr ( const IString rString  )  const [virtual]

See also:
IString::startsWithStr

Implements zeus::IString.

Int MQUALIFIER TString::compareTo ( const IString rString  )  const [virtual]

See also:
IString::compareTo

Implements zeus::IString.

bool MQUALIFIER zeus::TString::contains ( const wchar_t *  pSubString  )  const [inline, virtual]

See also:
IString::contains

Implements zeus::IString.

bool MQUALIFIER zeus::TString::containsStr ( const IString rSubString  )  const [inline, virtual]

See also:
IString::containsStr

Implements zeus::IString.

TString TString::convertDouble ( const Float &  rfValue,
Int  iDigit = 15 
) [static, protected]

Konvertieren eines Doublewerts in einen StString

Parameters:
fValue : double Wert
iDigit : Number of digits
Returns:
Formatierter String


The documentation for this class was generated from the following files:


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Wed Oct 28 21:42:36 2009