Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

String Class Reference

#include <String.h>

List of all members.


Detailed Description

The string class represents an encapsulation of a character array, providing automatic memory management.

It provides methods to concat, find, substring etc. The class always allocates some extra bytes so that many operations do not reallocate too often.

Author:
Thomas Jacob

Definition at line 55 of file String.h.

Public Member Functions

void Append (bool boolean)
 Adds a boolean string at the end of this string.

void Append (unsigned long number)
 Adds an unsigned long number at the end of this string.

void Append (long number)
 Adds a signed long number at the end of this string.

void Append (unsigned int number)
 Adds an unsigned int number at the end of this string.

void Append (int number)
 Adds a signed int number at the end of this string.

void Append (char character)
 Adds a character at the end of this string.

void Append (const char *string)
 Adds another string at the end of this one.

void Append (const class String *String)
 Adds another string at the end of this one.

void Append (const class String &String)
 Adds another string at the end of this one.

void Clear ()
 Clears the string, removing the content and setting the length to zero.

String Clone () const
 Returns a stack memory clone of this string.

int CompareTo (const char *string) const
 Compares this string to another one and returns -1, if this string is less than the given one, 0, if both strings are equal and 1, if this string is greater than the given one, in terms of the Compare function.

int CompareTo (const String *String) const
 Compares this string to another one and returns -1, if this string is less than the given one, 0, if both strings are equal and 1, if this string is greater than the given one, in terms of the Compare function.

int CompareTo (const String &String) const
 Compares this string to another one and returns -1, if this string is less than the given one, 0, if both strings are equal and 1, if this string is greater than the given one, in terms of the Compare function.

int CompareToIC (const char *string) const
 Compares this string to another one ignoring the caseand returns -1, if this string is less than the given one, 0, if both strings are equal and 1, if this string is greater than the given one, in terms of the CompareIC function.

int CompareToIC (const String *String) const
 Compares this string to another one ignoring the caseand returns -1, if this string is less than the given one, 0, if both strings are equal and 1, if this string is greater than the given one, in terms of the CompareIC function.

int CompareToIC (const String &String) const
 Compares this string to another one ignoring the caseand returns -1, if this string is less than the given one, 0, if both strings are equal and 1, if this string is greater than the given one, in terms of the CompareIC function.

bool Contains (const char *string) const
 Returns whether another string is contained in this string.

bool Contains (const class String *String) const
 Returns whether another string is contained in this string.

bool Contains (const class String &String) const
 Returns whether another string is contained in this string.

void Cut (unsigned int fromIndex, unsigned int length)
 Cuts off a part of the string, starting at a given index.

void Cut (unsigned int fromIndex)
 Cuts off a part of the string, starting at a given index.

bool EndsWith (const char *string) const
 Returns whether another string is part of the end of this string.

bool EndsWith (const class String *String) const
 Returns whether another string is part of the end of this string.

bool EndsWith (const class String &String) const
 Returns whether another string is part of the end of this string.

bool EndsWithIC (const char *string) const
 Returns whether another string is part of the end of this string, ignoring the case of the two strings.

bool EndsWithIC (const class String *String) const
 Returns whether another string is part of the end of this string, ignoring the case of the two strings.

bool EndsWithIC (const class String &String) const
 Returns whether another string is part of the end of this string, ignoring the case of the two strings.

bool Equals (const char *string) const
 Returns whether this string equals another one, in terms of the Compare function.

bool Equals (const class String *String) const
 Returns whether this string equals another one, in terms of the Compare function.

bool Equals (const class String &String) const
 Returns whether this string equals another one, in terms of the Compare function.

bool EqualsIC (const char *string) const
 Returns whether this string equals another one, in terms of the CompareIC function.

bool EqualsIC (const class String *String) const
 Returns whether this string equals another one, in terms of the CompareIC function.

bool EqualsIC (const class String &String) const
 Returns whether this string equals another one, in terms of the CompareIC function.

int Find (const char *string, unsigned int fromIndex) const
 Returns the first position of another string in this one, starting from a given position.

int Find (const class String *String, unsigned int fromIndex) const
 Returns the first position of another string in this one, starting from a given position.

int Find (const class String &String, unsigned int fromIndex) const
 Returns the first position of another string in this one, starting from a given position.

int Find (const char *string) const
 Returns the first position of another string in this one.

int Find (const class String *String) const
 Returns the first position of another string in this one.

int Find (const class String &String) const
 Returns the first position of another string in this one.

int FindIC (const char *string, unsigned int fromIndex) const
 Returns the first position of another string in this one, ignoring case, starting from a given position.

int FindIC (const class String *String, unsigned int fromIndex) const
 Returns the first position of another string in this one, ignoring case, starting from a given position.

int FindIC (const class String &String, unsigned int fromIndex) const
 Returns the first position of another string in this one, ignoring case, starting from a given position.

int FindIC (const char *string) const
 Returns the first position of another string in this one, ignoring case.

int FindIC (const class String *String) const
 Returns the first position of another string in this one, ignoring case.

int FindIC (const class String &String) const
 Returns the first position of another string in this one, ignoring case.

int FindLast (const char *string, unsigned int fromIndex) const
 Returns the last position of another string in this one, starting from a given position.

int FindLast (const class String *String, unsigned int fromIndex) const
 Returns the last position of another string in this one, starting from a given position.

int FindLast (const class String &String, unsigned int fromIndex) const
 Returns the last position of another string in this one, starting from a given position.

int FindLast (const char *string) const
 Returns the last position of another string in this one.

int FindLast (const class String *String) const
 Returns the last position of another string in this one.

int FindLast (const class String &String) const
 Returns the last position of another string in this one.

int FindLastIC (const char *string, unsigned int fromIndex) const
 Returns the last position of another string in this one, ignoring case, starting from a given position.

int FindLastIC (const class String *String, unsigned int fromIndex) const
 Returns the last position of another string in this one, ignoring case, starting from a given position.

int FindLastIC (const class String &String, unsigned int fromIndex) const
 Returns the last position of another string in this one, ignoring case, starting from a given position.

int FindLastIC (const char *string) const
 Returns the last position of another string in this one, ignoring case.

int FindLastIC (const class String *String) const
 Returns the last position of another string in this one, ignoring case.

int FindLastIC (const class String &String) const
 Returns the last position of another string in this one, ignoring case.

void Format (const char *format,...)
 Formats a string the same way sprintf does.

void FormatFromVargs (const char *format, const va_list &arguments)
 Formats a string the same way vsprintf does.

unsigned int GetLength () const
 Returns the length of the string.

StringHeapClone () const
 Returns a heap memory clone of this string.

void Insert (bool boolean, unsigned int index)
 Inserts a boolean string at a given position of this string.

void Insert (unsigned long number, unsigned int index)
 Inserts an unsigned long number at a given position of this string.

void Insert (long number, unsigned int index)
 Inserts a signed long number at a given position of this string.

void Insert (unsigned int number, unsigned int index)
 Inserts an unsigned int number at a given position of this string.

void Insert (int number, unsigned int index)
 Inserts a signed int number at a given position of this string.

void Insert (char character, unsigned int index)
 Inserts a character at a given position of this string.

void Insert (const char *string, unsigned int index)
 Inserts another string at a given position of this one.

void Insert (const class String *String, unsigned int index)
 Inserts another string at a given position of this one.

void Insert (const class String &String, unsigned int index)
 Inserts another string at a given position of this one.

bool IsEmpty () const
 Returns whether this string is empty (zero length).

 operator const char * () const
 Returns a C style string containing the data of this object.

bool operator!= (const char *string) const
 Returns whether this string does not equal another one, in terms of the Compare function.

bool operator!= (const class String *String) const
 Returns whether this string does not equal another one, in terms of the Compare function.

bool operator!= (const class String &String) const
 Returns whether this string does not equal another one, in terms of the Compare function.

String operator+ (bool boolean) const
 Returns the concatenation of this string and a boolean string.

String operator+ (unsigned long number) const
 Returns the concatenation of this string and an unsigned long number.

String operator+ (long number) const
 Returns the concatenation of this string and a signed long number.

String operator+ (unsigned int number) const
 Returns the concatenation of this string and an unsigned int number.

String operator+ (int number) const
 Returns the concatenation of this string and a signed int number.

String operator+ (char character) const
 Returns the concatenation of this string and a character.

String operator+ (const char *string) const
 Returns the concatenation of this string and another one.

String operator+ (const class String *String) const
 Returns the concatenation of this string and another one.

String operator+ (const class String &String) const
 Returns the concatenation of this string and another one.

void operator+= (bool boolean)
 Adds a boolean string at the end of this string.

void operator+= (unsigned long number)
 Adds an unsigned long number at the end of this string.

void operator+= (long number)
 Adds a signed long number at the end of this string.

void operator+= (unsigned int number)
 Adds an unsigned int number at the end of this string.

void operator+= (int number)
 Adds a signed int number at the end of this string.

void operator+= (char character)
 Adds a character at the end of this string.

void operator+= (const char *string)
 Adds another string at the end of this one.

void operator+= (const class String *String)
 Adds another string at the end of this one.

void operator+= (const class String &String)
 Adds another string at the end of this one.

bool operator< (const char *string) const
 Returns whether this string is less than another one, in terms of the Compare function.

bool operator< (const class String *String) const
 Returns whether this string is less than another one, in terms of the Compare function.

bool operator< (const class String &String) const
 Returns whether this string is less than another one, in terms of the Compare function.

bool operator<= (const char *string) const
 Returns whether this string is less than or equals another one, in terms of the Compare function.

bool operator<= (const class String *String) const
 Returns whether this string is less than or equals another one, in terms of the Compare function.

bool operator<= (const class String &String) const
 Returns whether this string is less than or equals another one, in terms of the Compare function.

void operator= (bool boolean)
 Sets a boolean string into this string.

void operator= (unsigned long number)
 Sets an unsigned long number into this string.

void operator= (long number)
 Sets a signed long number into this string.

void operator= (unsigned int number)
 Sets an unsigned int number into this string.

void operator= (int number)
 Sets a signed int number into this string.

void operator= (char character)
 Sets a character into this string.

void operator= (const char *string)
 Sets another string into this one.

void operator= (const class String *String)
 Sets another string into this one.

void operator= (const class String &String)
 Sets another string into this one.

bool operator== (const char *string) const
 Returns whether this string equals another one, in terms of the Compare function.

bool operator== (const class String *String) const
 Returns whether this string equals another one, in terms of the Compare function.

bool operator== (const class String &String) const
 Returns whether this string equals another one, in terms of the Compare function.

bool operator> (const char *string) const
 Returns whether this string is greater than another one, in terms of the Compare function.

bool operator> (const class String *String) const
 Returns whether this string is greater than another one, in terms of the Compare function.

bool operator> (const class String &String) const
 Returns whether this string is greater than another one, in terms of the Compare function.

bool operator>= (const char *string) const
 Returns whether this string is greater than or equals another one, in terms of the Compare function.

bool operator>= (const class String *String) const
 Returns whether this string is greater than or equals another one, in terms of the Compare function.

bool operator>= (const class String &String) const
 Returns whether this string is greater than or equals another one, in terms of the Compare function.

char operator[] (int index) const
 Returns a character at a given index of the string.

void Prepend (bool boolean)
 Prepends a boolean string at the beginning of this string.

void Prepend (unsigned long number)
 Prepends an unsigned long number at the beginning of this string.

void Prepend (long number)
 Prepends a signed long number at the beginning of this string.

void Prepend (unsigned int number)
 Prepends an unsigned int number at the beginning of this string.

void Prepend (int number)
 Prepends a signed int number at the beginning of this string.

void Prepend (char character)
 Prepends a character at the beginning of this string.

void Prepend (const char *string)
 Prepends another string at the beginning of this one.

void Prepend (const class String *String)
 Prepends another string at the beginning of this one.

void Prepend (const class String &String)
 Prepends another string at the beginning of this one.

bool ReadFrom (FILE *file)
 Reads the contents of a given file into this String, using a buffer.

bool ReadFrom (const char *fileName, bool textMode)
 Reads the contents of a given file into this String, using a buffer.

void Replace (char character, char replacement)
 Finds all occurences of a character in this string and replaces it by another one.

void Replace (const char *text, const char *replacement)
 Finds all occurences of a string in this one and replaces it by another one.

void Replace (const String *Text, const String *Replacement)
 Finds all occurences of a string in this one and replaces it by another one.

void Replace (const String &Text, const String &Replacement)
 Finds all occurences of a string in this one and replaces it by another one.

bool StartsWith (const char *string) const
 Returns whether another string is part of the start of this string.

bool StartsWith (const class String *String) const
 Returns whether another string is part of the start of this string.

bool StartsWith (const class String &String) const
 Returns whether another string is part of the start of this string.

bool StartsWithIC (const char *string) const
 Returns whether another string is part of the start of this string, ignoring the case of the two strings.

bool StartsWithIC (const class String *String) const
 Returns whether another string is part of the start of this string, ignoring the case of the two strings.

bool StartsWithIC (const class String &String) const
 Returns whether another string is part of the start of this string, ignoring the case of the two strings.

 String (bool boolean)
 Creates a new string that contains 'true' or 'false'.

 String (unsigned long number)
 Creates a new string that contains an unsigned long number.

 String (long number)
 Creates a new string that contains an signed long number.

 String (unsigned int number)
 Creates a new string that contains an unsigned int number.

 String (int number)
 Creates a new string that contains an signed int number.

 String (char character)
 Creates a new string that contains one character.

 String (const char *string, unsigned int fromIndex, unsigned int length)
 Creates a new string from a substring of another string.

 String (const class String *String, unsigned int fromIndex, unsigned int length)
 Creates a new string from a substring of another string.

 String (const class String &String, unsigned int fromIndex, unsigned int length)
 Creates a new string from a substring of another string.

 String (const char *string)
 Creates a new string from another one.

 String (const class String *String)
 Creates a new string from another one.

 String (const class String &String)
 Copy constructor: Creates a new string from another one.

 String ()
 Creates a new empty string.

String Substring (unsigned int fromIndex) const
 Returns a substring of this one.

String Substring (unsigned int fromIndex, unsigned int length) const
 Returns a substring of this one.

void ToLowerCase ()
 Converts all upper case characters of this string to lower case.

void ToUpperCase ()
 Converts all lower case characters of this string to upper case.

void Trim ()
 Removes all white space (space, CR, LF, FF, and tab) from the start and the end of this string, but not in the middle.

void TrimLeft ()
 Removes all white space (space, CR, LF, FF, and tab) from the start of this string.

void TrimRight ()
 Removes all white space (space, CR, LF, FF, and tab) from the end of this string.

bool WriteTo (FILE *file)
 Writes the contents of this String into a given file.

bool WriteTo (const char *fileName, bool textMode, bool append=false)
 Writes the contents of this String into a given file.

 ~String ()
 Destroys the string, also deleting the Data buffer.


Static Public Member Functions

int Compare (const char *string1, const char *string2)
 Compares two strings and returns -1, if the first is less than the second, 0, if both strings are equal and 1, if the first is greater than the second.

int Compare (const String *String1, const String *String2)
 Compares two strings and returns -1, if the first is less than the second, 0, if both strings are equal and 1, if the first is greater than the second.

int Compare (const String &String1, const String &String2)
 Compares two strings and returns -1, if the first is less than the second, 0, if both strings are equal and 1, if the first is greater than the second.

int CompareIC (const char *string1, const char *string2)
 Compares two strings ignoring the case and returns -1, if the first is less than the second, 0, if both strings are equal and 1, if the first is greater than the second.

int CompareIC (const String *String1, const String *String2)
 Compares two strings ignoring the case and returns -1, if the first is less than the second, 0, if both strings are equal and 1, if the first is greater than the second.

int CompareIC (const String &String1, const String &String2)
 Compares two strings ignoring the case and returns -1, if the first is less than the second, 0, if both strings are equal and 1, if the first is greater than the second.

bool IsCharacter (unsigned char character)
 Returns whether a given character is a letter in the ISO-8859-1 encoding.

bool IsDigit (unsigned char character)
 Returns whether a given character is a digit in the ISO-8859-1 encoding.

bool IsLowerCharacter (unsigned char character)
 Returns whether a given character is a lower-case letter in the ISO-8859-1 encoding.

bool IsUpperCharacter (unsigned char character)
 Returns whether a given character is a upper-case letter in the ISO-8859-1 encoding.

bool IsValid (unsigned char character)
 Returns whether a given character is part of the ISO-8859-1 encoding.

bool IsWhiteSpace (unsigned char character)
 Returns whether a given character is white space in the ISO-8859-1 encoding.

unsigned char ToLowerCase (unsigned char character)
 Converts a given character to lower case, if it is an upper case character.

unsigned char ToUpperCase (unsigned char character)
 Converts a given character to upper case, if it is an lower case character.


Private Member Functions

void Allocate (unsigned int minimumSize)
 Allocates memory for the Data and sets into this variable.


Private Attributes

char * Data
 The buffer that carries the string data.

unsigned int Size
 The size of the allocated buffer 'Data'.


Constructor & Destructor Documentation

String  ) 
 

Creates a new empty string.

String const class String String  ) 
 

Copy constructor: Creates a new string from another one.

Parameters:
String The string that serves as a template.

String const class String String  ) 
 

Creates a new string from another one.

Parameters:
String The string that serves as a template.

String const char *  string  ) 
 

Creates a new string from another one.

Parameters:
string The string that serves as a template.

String const class String String,
unsigned int  fromIndex,
unsigned int  length
 

Creates a new string from a substring of another string.

Parameters:
string The string to read from.
fromIndex The position of the first character to include. Must be valid.
length The length of the substring to be extracted. Must be valid.

String const class String String,
unsigned int  fromIndex,
unsigned int  length
 

Creates a new string from a substring of another string.

Parameters:
string The string to read from.
fromIndex The position of the first character to include. Must be valid.
length The length of the substring to be extracted. Must be valid.

String const char *  string,
unsigned int  fromIndex,
unsigned int  length
 

Creates a new string from a substring of another string.

Parameters:
string The string to read from.
fromIndex The position of the first character to include. Must be valid.
length The length of the substring to be extracted. Must be valid.

String char  character  ) 
 

Creates a new string that contains one character.

Parameters:
character The character to put into the string.

String int  number  ) 
 

Creates a new string that contains an signed int number.

Parameters:
number The long number to put into the string.

String unsigned int  number  )  [inline]
 

Creates a new string that contains an unsigned int number.

Parameters:
number The unsigned long number to put into the string.

String long  number  ) 
 

Creates a new string that contains an signed long number.

Parameters:
number The long number to put into the string.

String unsigned long  number  ) 
 

Creates a new string that contains an unsigned long number.

Parameters:
number The unsigned long number to put into the string.

String bool  boolean  ) 
 

Creates a new string that contains 'true' or 'false'.

Parameters:
boolean The boolean to put into the string.

~String  ) 
 

Destroys the string, also deleting the Data buffer.

So the memory returned by the (const char *) operator must not be accessed anymore after the deletion.


Member Function Documentation

void Allocate unsigned int  minimumSize  )  [private]
 

Allocates memory for the Data and sets into this variable.

The old pointer is overwritten. The Size is also updated. The method ensures that a given amount of bytes is allocated at least, but the method allocates some more memory to reduce reallocation on string changes.

Parameters:
minimumSize The minimum byte count to be allocated.

void Append bool  boolean  ) 
 

Adds a boolean string at the end of this string.

Parameters:
boolean The boolean to be added.

void Append unsigned long  number  ) 
 

Adds an unsigned long number at the end of this string.

Parameters:
number The number to be added.

void Append long  number  ) 
 

Adds a signed long number at the end of this string.

Parameters:
number The number to be added.

void Append unsigned int  number  )  [inline]
 

Adds an unsigned int number at the end of this string.

Parameters:
number The number to be added.

void Append int  number  ) 
 

Adds a signed int number at the end of this string.

Parameters:
number The number to be added.

void Append char  character  ) 
 

Adds a character at the end of this string.

Parameters:
character The character to be added.

void Append const char *  string  ) 
 

Adds another string at the end of this one.

Parameters:
string The string to be added.

void Append const class String String  )  [inline]
 

Adds another string at the end of this one.

Parameters:
String The string to be added.

void Append const class String String  )  [inline]
 

Adds another string at the end of this one.

Parameters:
String The string to be added.

void Clear  )  [inline]
 

Clears the string, removing the content and setting the length to zero.

String Clone  )  const [inline]
 

Returns a stack memory clone of this string.

Returns:
The stack memory clone.

int Compare const char *  string1,
const char *  string2
[static]
 

Compares two strings and returns -1, if the first is less than the second, 0, if both strings are equal and 1, if the first is greater than the second.

Note:
This method is used for all case sensitive comparisons.
Parameters:
string1 The first string to be compared.
string2 The second string to be compared.
Returns:
-1, 0 or 1, if string1 < string2, string1 == string2, resp. string1 > string2.

int Compare const String String1,
const String String2
[inline, static]
 

Compares two strings and returns -1, if the first is less than the second, 0, if both strings are equal and 1, if the first is greater than the second.

Parameters:
String1 The first string to be compared.
String2 The second string to be compared.
Returns:
-1, 0 or 1, if String1 < String2, String1 == String2, resp. String1 > String2.

int Compare const String String1,
const String String2
[inline, static]
 

Compares two strings and returns -1, if the first is less than the second, 0, if both strings are equal and 1, if the first is greater than the second.

Parameters:
String1 The first string to be compared.
String2 The second string to be compared.
Returns:
-1, 0 or 1, if String1 < String2, String1 == String2, resp. String1 > String2.

int CompareIC const char *  string1,
const char *  string2
[static]
 

Compares two strings ignoring the case and returns -1, if the first is less than the second, 0, if both strings are equal and 1, if the first is greater than the second.

Note:
This method is used for all case insensitive comparisons.
Parameters:
string1 The first string to be compared.
string2 The second string to be compared.
Returns:
-1, 0 or 1, if string1 < string2, string1 == string2, resp. string1 > string2 (ignoring the case).

int CompareIC const String String1,
const String String2
[inline, static]
 

Compares two strings ignoring the case and returns -1, if the first is less than the second, 0, if both strings are equal and 1, if the first is greater than the second.

Parameters:
String1 The first string to be compared.
String2 The second string to be compared.
Returns:
-1, 0 or 1, if String1 < String2, String1 == String2, resp. String1 > String2 (ignoring the case).

int CompareIC const String String1,
const String String2
[inline, static]
 

Compares two strings ignoring the case and returns -1, if the first is less than the second, 0, if both strings are equal and 1, if the first is greater than the second.

Parameters:
String1 The first string to be compared.
String2 The second string to be compared.
Returns:
-1, 0 or 1, if String1 < String2, String1 == String2, resp. String1 > String2 (ignoring the case).

int CompareTo const char *  string  )  const [inline]
 

Compares this string to another one and returns -1, if this string is less than the given one, 0, if both strings are equal and 1, if this string is greater than the given one, in terms of the Compare function.

Parameters:
string The string to compare to.
Returns:
-1, 0 or 1, if this < string, this == string, resp. this > string.

int CompareTo const String String  )  const [inline]
 

Compares this string to another one and returns -1, if this string is less than the given one, 0, if both strings are equal and 1, if this string is greater than the given one, in terms of the Compare function.

Parameters:
String The string to compare to.
Returns:
-1, 0 or 1, if this < String, this == String, resp. this > String.

int CompareTo const String String  )  const [inline]
 

Compares this string to another one and returns -1, if this string is less than the given one, 0, if both strings are equal and 1, if this string is greater than the given one, in terms of the Compare function.

Parameters:
String The string to compare to.
Returns:
-1, 0 or 1, if this < String, this == String, resp. this > String.

int CompareToIC const char *  string  )  const [inline]
 

Compares this string to another one ignoring the caseand returns -1, if this string is less than the given one, 0, if both strings are equal and 1, if this string is greater than the given one, in terms of the CompareIC function.

Parameters:
string The string to compare to.
Returns:
-1, 0 or 1, if this < string, this == string, resp. this > string (ignoring the case).

int CompareToIC const String String  )  const [inline]
 

Compares this string to another one ignoring the caseand returns -1, if this string is less than the given one, 0, if both strings are equal and 1, if this string is greater than the given one, in terms of the CompareIC function.

Parameters:
String The string to compare to.
Returns:
-1, 0 or 1, if this < String, this == String, resp. this > String (ignoring the case).

int CompareToIC const String String  )  const [inline]
 

Compares this string to another one ignoring the caseand returns -1, if this string is less than the given one, 0, if both strings are equal and 1, if this string is greater than the given one, in terms of the CompareIC function.

Parameters:
String The string to compare to.
Returns:
-1, 0 or 1, if this < String, this == String, resp. this > String (ignoring the case).

bool Contains const char *  string  )  const [inline]
 

Returns whether another string is contained in this string.

Parameters:
string The string to be tested.
Returns:
Whether the given string is contained in this string.

bool Contains const class String String  )  const [inline]
 

Returns whether another string is contained in this string.

Parameters:
String The string to be tested.
Returns:
Whether the given string is contained in this string.

bool Contains const class String String  )  const [inline]
 

Returns whether another string is contained in this string.

Parameters:
String The string to be tested.
Returns:
Whether the given string is contained in this string.

void Cut unsigned int  fromIndex,
unsigned int  length
 

Cuts off a part of the string, starting at a given index.

The remaining string will contain the part before the index and the part after the index plus the provided cut length.

Parameters:
fromIndex The 0-indexed position of the first character to be cut. It is legal for this parameter to be out of range. In this case, the string no cut.
length The number of characters to be cut. It is legal for this parameter to be out of range. In this case, the whole right part is cut.

void Cut unsigned int  fromIndex  ) 
 

Cuts off a part of the string, starting at a given index.

The remaining string will contain the part before the index only.

Parameters:
fromIndex The 0-indexed position of the first character to be cut. It is legal for this parameter to be out of range. In this case, the string no cut.

bool EndsWith const char *  string  )  const
 

Returns whether another string is part of the end of this string.

Parameters:
string The string to be tested.
Returns:
Whether the given string is part of the end of this string.

bool EndsWith const class String String  )  const [inline]
 

Returns whether another string is part of the end of this string.

Parameters:
String The string to be tested.
Returns:
Whether the given string is part of the end of this string.

bool EndsWith const class String String  )  const [inline]
 

Returns whether another string is part of the end of this string.

Parameters:
String The string to be tested.
Returns:
Whether the given string is part of the end of this string.

bool EndsWithIC const char *  string  )  const
 

Returns whether another string is part of the end of this string, ignoring the case of the two strings.

Parameters:
string The string to be tested.
Returns:
Whether the given string is part of the end of this string.

bool EndsWithIC const class String String  )  const [inline]
 

Returns whether another string is part of the end of this string, ignoring the case of the two strings.

Parameters:
String The string to be tested.
Returns:
Whether the given string is part of the end of this string.

bool EndsWithIC const class String String  )  const [inline]
 

Returns whether another string is part of the end of this string, ignoring the case of the two strings.

Parameters:
String The string to be tested.
Returns:
Whether the given string is part of the end of this string.

bool Equals const char *  string  )  const [inline]
 

Returns whether this string equals another one, in terms of the Compare function.

Note:
This method is the same as the '==' operator.
Parameters:
string The other string.
Returns:
Whether this string equals another one.

bool Equals const class String String  )  const [inline]
 

Returns whether this string equals another one, in terms of the Compare function.

Note:
This method is the same as the '==' operator.
Parameters:
String The other string.
Returns:
Whether this string equals another one.

bool Equals const class String String  )  const [inline]
 

Returns whether this string equals another one, in terms of the Compare function.

Note:
This method is the same as the '==' operator.
Parameters:
String The other string.
Returns:
Whether this string equals another one.

bool EqualsIC const char *  string  )  const [inline]
 

Returns whether this string equals another one, in terms of the CompareIC function.

Parameters:
string The other string.
Returns:
Whether this string equals another one.

bool EqualsIC const class String String  )  const [inline]
 

Returns whether this string equals another one, in terms of the CompareIC function.

Parameters:
String The other string.
Returns:
Whether this string equals another one.

bool EqualsIC const class String String  )  const [inline]
 

Returns whether this string equals another one, in terms of the CompareIC function.

Parameters:
String The other string.
Returns:
Whether this string equals another one.

int Find const char *  string,
unsigned int  fromIndex
const
 

Returns the first position of another string in this one, starting from a given position.

Parameters:
string The string to be searched.
fromIndex The 0-indexed position to start the search at. Only matches starting at fromIndex or higher are accounted for. It is legal for this parameter to be out of range. If the value is too large, the string is not searched.
Returns:
The 0-indexed first position of the string or -1, if the string cannot be found. The index counts from the start of the string, not from the given fromIndex. Only matches starting at fromIndex or higher are accounted for.

int Find const class String String,
unsigned int  fromIndex
const [inline]
 

Returns the first position of another string in this one, starting from a given position.

Parameters:
String The string to be searched.
fromIndex The 0-indexed position to start the search at. Only matches starting at fromIndex or higher are accounted for. It is legal for this parameter to be out of range. If the value is too large, the string is not searched.
Returns:
The 0-indexed first position of the string or -1, if the string cannot be found. The index counts from the start of the string, not from the given fromIndex. Only matches starting at fromIndex or higher are accounted for.

int Find const class String String,
unsigned int  fromIndex
const [inline]
 

Returns the first position of another string in this one, starting from a given position.

Parameters:
String The string to be searched.
fromIndex The 0-indexed position to start the search at. Only matches starting at fromIndex or higher are accounted for. It is legal for this parameter to be out of range. If the value is too large, the string is not searched.
Returns:
The 0-indexed first position of the string or -1, if the string cannot be found. The index counts from the start of the string, not from the given fromIndex. Only matches starting at fromIndex or higher are accounted for.

int Find const char *  string  )  const
 

Returns the first position of another string in this one.

Parameters:
string The string to be searched.
Returns:
The 0-indexed first position of the string or -1, if the string cannot be found.

int Find const class String String  )  const [inline]
 

Returns the first position of another string in this one.

Parameters:
String The string to be searched.
Returns:
The 0-indexed first position of the string or -1, if the string cannot be found.

int Find const class String String  )  const [inline]
 

Returns the first position of another string in this one.

Parameters:
String The string to be searched.
Returns:
The 0-indexed first position of the string or -1, if the string cannot be found.

int FindIC const char *  string,
unsigned int  fromIndex
const
 

Returns the first position of another string in this one, ignoring case, starting from a given position.

Parameters:
string The string to be searched.
fromIndex The 0-indexed position to start the search at. Only matches starting at fromIndex or higher are accounted for. It is legal for this parameter to be out of range. If the value is too large, the string is not searched.
Returns:
The 0-indexed first position of the string (ignoring case) or -1, if the string cannot be found. The index counts from the start of the string, not from the given fromIndex. Only matches starting at fromIndex or higher are accounted for.

int FindIC const class String String,
unsigned int  fromIndex
const [inline]
 

Returns the first position of another string in this one, ignoring case, starting from a given position.

Parameters:
String The string to be searched.
fromIndex The 0-indexed position to start the search at. Only matches starting at fromIndex or higher are accounted for. It is legal for this parameter to be out of range. If the value is too large, the string is not searched.
Returns:
The 0-indexed first position of the string (ignoring case) or -1, if the string cannot be found. The index counts from the start of the string, not from the given fromIndex. Only matches starting at fromIndex or higher are accounted for.

int FindIC const class String String,
unsigned int  fromIndex
const [inline]
 

Returns the first position of another string in this one, ignoring case, starting from a given position.

Parameters:
String The string to be searched.
fromIndex The 0-indexed position to start the search at. Only matches starting at fromIndex or higher are accounted for. It is legal for this parameter to be out of range. If the value is too large, the string is not searched.
Returns:
The 0-indexed first position of the string (ignoring case) or -1, if the string cannot be found. The index counts from the start of the string, not from the given fromIndex. Only matches starting at fromIndex or higher are accounted for.

int FindIC const char *  string  )  const [inline]
 

Returns the first position of another string in this one, ignoring case.

Parameters:
string The string to be searched.
Returns:
The 0-indexed first position of the string (ignoring case) or -1, if the string cannot be found.

int FindIC const class String String  )  const [inline]
 

Returns the first position of another string in this one, ignoring case.

Parameters:
String The string to be searched.
Returns:
The 0-indexed first position of the string (ignoring case) or -1, if the string cannot be found.

int FindIC const class String String  )  const [inline]
 

Returns the first position of another string in this one, ignoring case.

Parameters:
String The string to be searched.
Returns:
The 0-indexed first position of the string (ignoring case) or -1, if the string cannot be found.

int FindLast const char *  string,
unsigned int  fromIndex
const
 

Returns the last position of another string in this one, starting from a given position.

Parameters:
string The string to be searched.
fromIndex The 0-indexed position to start the search at. Only matches starting at fromIndex or less are accounted for. It is legal for this parameter to be out of range. If the value is too large, the string is searched from the end.
Returns:
The 0-indexed last position of the string or -1, if the string cannot be found. The index counts from the start of the string, not from the given fromIndex. Only matches starting at fromIndex or less are accounted for.

int FindLast const class String String,
unsigned int  fromIndex
const [inline]
 

Returns the last position of another string in this one, starting from a given position.

Parameters:
String The string to be searched.
fromIndex The 0-indexed position to start the search at. Only matches starting at fromIndex or less are accounted for. It is legal for this parameter to be out of range. If the value is too large, the string is searched from the end.
Returns:
The 0-indexed last position of the string or -1, if the string cannot be found. The index counts from the start of the string, not from the given fromIndex. Only matches starting at fromIndex or less are accounted for.

int FindLast const class String String,
unsigned int  fromIndex
const [inline]
 

Returns the last position of another string in this one, starting from a given position.

Parameters:
String The string to be searched.
fromIndex The 0-indexed position to start the search at. Only matches starting at fromIndex or less are accounted for. It is legal for this parameter to be out of range. If the value is too large, the string is searched from the end.
Returns:
The 0-indexed last position of the string or -1, if the string cannot be found. The index counts from the start of the string, not from the given fromIndex. Only matches starting at fromIndex or less are accounted for.

int FindLast const char *  string  )  const [inline]
 

Returns the last position of another string in this one.

Parameters:
string The string to be searched.
Returns:
The 0-indexed last position of the string or -1, if the string cannot be found.

int FindLast const class String String  )  const [inline]
 

Returns the last position of another string in this one.

Parameters:
String The string to be searched.
Returns:
The 0-indexed last position of the string or -1, if the string cannot be found.

int FindLast const class String String  )  const [inline]
 

Returns the last position of another string in this one.

Parameters:
String The string to be searched.
Returns:
The 0-indexed last position of the string or -1, if the string cannot be found.

int FindLastIC const char *  string,
unsigned int  fromIndex
const
 

Returns the last position of another string in this one, ignoring case, starting from a given position.

Parameters:
string The string to be searched.
fromIndex The 0-indexed position to start the search at. Only matches starting at fromIndex or less are accounted for. It is legal for this parameter to be out of range. If the value is too large, the string is searched from the end.
Returns:
The 0-indexed last position of the string (ignoring case) or -1, if the string cannot be found. The index counts from the start of the string, not from the given fromIndex. Only matches starting at fromIndex or less are accounted for.

int FindLastIC const class String String,
unsigned int  fromIndex
const [inline]
 

Returns the last position of another string in this one, ignoring case, starting from a given position.

Parameters:
String The string to be searched.
fromIndex The 0-indexed position to start the search at. Only matches starting at fromIndex or less are accounted for. It is legal for this parameter to be out of range. If the value is too large, the string is searched from the end.
Returns:
The 0-indexed last position of the string (ignoring case) or -1, if the string cannot be found. The index counts from the start of the string, not from the given fromIndex. Only matches starting at fromIndex or less are accounted for.

int FindLastIC const class String String,
unsigned int  fromIndex
const [inline]
 

Returns the last position of another string in this one, ignoring case, starting from a given position.

Parameters:
String The string to be searched.
fromIndex The 0-indexed position to start the search at. Only matches starting at fromIndex or less are accounted for. It is legal for this parameter to be out of range. If the value is too large, the string is searched from the end.
Returns:
The 0-indexed last position of the string (ignoring case) or -1, if the string cannot be found. The index counts from the start of the string, not from the given fromIndex. Only matches starting at fromIndex or less are accounted for.

int FindLastIC const char *  string  )  const [inline]
 

Returns the last position of another string in this one, ignoring case.

Parameters:
string The string to be searched.
Returns:
The 0-indexed last position of the string (ignoring case) or -1, if the string cannot be found.

int FindLastIC const class String String  )  const [inline]
 

Returns the last position of another string in this one, ignoring case.

Parameters:
String The string to be searched.
Returns:
The 0-indexed last position of the string (ignoring case) or -1, if the string cannot be found.

int FindLastIC const class String String  )  const [inline]
 

Returns the last position of another string in this one, ignoring case.

Parameters:
String The string to be searched.
Returns:
The 0-indexed last position of the string (ignoring case) or -1, if the string cannot be found.

void Format const char *  format,
... 
 

Formats a string the same way sprintf does.

The result is put into this string.

Parameters:
format The sprintf style format.
... The optional parameters, see sprintf for details.

void FormatFromVargs const char *  format,
const va_list &  arguments
 

Formats a string the same way vsprintf does.

The result is put into this string.

Parameters:
format The sprintf style format.
arguments The va_list arguments, see vsprintf for details.

unsigned int GetLength  )  const
 

Returns the length of the string.

Returns:
The length.

String* HeapClone  )  const
 

Returns a heap memory clone of this string.

Returns:
The heap memory clone.

void Insert bool  boolean,
unsigned int  index
 

Inserts a boolean string at a given position of this string.

Parameters:
boolean The boolean to be added.
index The 0-indexed position for the insertion. It is legal for this parameter to be out of range. In this case, the boolean is appended.

void Insert unsigned long  number,
unsigned int  index
 

Inserts an unsigned long number at a given position of this string.

Parameters:
number The number to be added.
index The 0-indexed position for the insertion. It is legal for this parameter to be out of range. In this case, the number is appended.

void Insert long  number,
unsigned int  index
 

Inserts a signed long number at a given position of this string.

Parameters:
number The number to be added.
index The 0-indexed position for the insertion. It is legal for this parameter to be out of range. In this case, the number is appended.

void Insert unsigned int  number,
unsigned int  index
[inline]
 

Inserts an unsigned int number at a given position of this string.

Parameters:
number The number to be added.
index The 0-indexed position for the insertion. It is legal for this parameter to be out of range. In this case, the number is appended.

void Insert int  number,
unsigned int  index
 

Inserts a signed int number at a given position of this string.

Parameters:
number The number to be added.
index The 0-indexed position for the insertion. It is legal for this parameter to be out of range. In this case, the number is appended.

void Insert char  character,
unsigned int  index
 

Inserts a character at a given position of this string.

Parameters:
character The character to be added.
index The 0-indexed position for the insertion. It is legal for this parameter to be out of range. In this case, the character is appended.

void Insert const char *  string,
unsigned int  index
 

Inserts another string at a given position of this one.

Parameters:
string The string to be added.
index The 0-indexed position for the insertion. It is legal for this parameter to be out of range. In this case, the string is appended.

void Insert const class String String,
unsigned int  index
[inline]
 

Inserts another string at a given position of this one.

Parameters:
String The string to be added.
index The 0-indexed position for the insertion. It is legal for this parameter to be out of range. In this case, the string is appended.

void Insert const class String String,
unsigned int  index
[inline]
 

Inserts another string at a given position of this one.

Parameters:
String The string to be added.
index The 0-indexed position for the insertion. It is legal for this parameter to be out of range. In this case, the string is appended.

bool IsCharacter unsigned char  character  )  [static]
 

Returns whether a given character is a letter in the ISO-8859-1 encoding.

Parameters:
character The character to be tested.
Returns:
Whether the character is a letter in the ISO-8859-1 encoding.

bool IsDigit unsigned char  character  )  [static]
 

Returns whether a given character is a digit in the ISO-8859-1 encoding.

Parameters:
character The character to be tested.
Returns:
Whether the character is a digit in the ISO-8859-1 encoding.

bool IsEmpty  )  const [inline]
 

Returns whether this string is empty (zero length).

Returns:
Whether this string is empty.

bool IsLowerCharacter unsigned char  character  )  [static]
 

Returns whether a given character is a lower-case letter in the ISO-8859-1 encoding.

Parameters:
character The character to be tested.
Returns:
Whether the character is a lower-case letter in the ISO-8859-1 encoding.

bool IsUpperCharacter unsigned char  character  )  [static]
 

Returns whether a given character is a upper-case letter in the ISO-8859-1 encoding.

Parameters:
character The character to be tested.
Returns:
Whether the character is a upper-case letter in the ISO-8859-1 encoding.

bool IsValid unsigned char  character  )  [static]
 

Returns whether a given character is part of the ISO-8859-1 encoding.

Parameters:
character The character to be tested.
Returns:
Whether the character is part of the ISO-8859-1 encoding.

bool IsWhiteSpace unsigned char  character  )  [static]
 

Returns whether a given character is white space in the ISO-8859-1 encoding.

Parameters:
character The character to be tested.
Returns:
Whether the character is white space in the ISO-8859-1 encoding.

operator const char *  )  const [inline]
 

Returns a C style string containing the data of this object.

Returns:
The C style string.

bool operator!= const char *  string  )  const [inline]
 

Returns whether this string does not equal another one, in terms of the Compare function.

Parameters:
string The other string.
Returns:
Whether this string does not equal another one.
See also:
Equals()

EqualsIC()

bool operator!= const class String String  )  const [inline]
 

Returns whether this string does not equal another one, in terms of the Compare function.

Parameters:
String The other string.
Returns:
Whether this string does not equal another one.
See also:
Equals()

EqualsIC()

bool operator!= const class String String  )  const [inline]
 

Returns whether this string does not equal another one, in terms of the Compare function.

Parameters:
String The other string.
Returns:
Whether this string does not equal another one.
See also:
Equals()

EqualsIC()

String operator+ bool  boolean  )  const [inline]
 

Returns the concatenation of this string and a boolean string.

Note:
Creating a new string by this method usually is less efficient than modifying an existing one (using += or Append).
Parameters:
boolean The boolean to be added.
Returns:
The concatenation.

String operator+ unsigned long  number  )  const [inline]
 

Returns the concatenation of this string and an unsigned long number.

Note:
Creating a new string by this method usually is less efficient than modifying an existing one (using += or Append).
Parameters:
number The number to be added.
Returns:
The concatenation.

String operator+ long  number  )  const [inline]
 

Returns the concatenation of this string and a signed long number.

Note:
Creating a new string by this method usually is less efficient than modifying an existing one (using += or Append).
Parameters:
number The number to be added.
Returns:
The concatenation.

String operator+ unsigned int  number  )  const [inline]
 

Returns the concatenation of this string and an unsigned int number.

Note:
Creating a new string by this method usually is less efficient than modifying an existing one (using += or Append).
Parameters:
number The number to be added.
Returns:
The concatenation.

String operator+ int  number  )  const [inline]
 

Returns the concatenation of this string and a signed int number.

Note:
Creating a new string by this method usually is less efficient than modifying an existing one (using += or Append).
Parameters:
number The number to be added.
Returns:
The concatenation.

String operator+ char  character  )  const [inline]
 

Returns the concatenation of this string and a character.

Note:
Creating a new string by this method usually is less efficient than modifying an existing one (using += or Append).
Parameters:
character The character to be added.
Returns:
The concatenation.

String operator+ const char *  string  )  const [inline]
 

Returns the concatenation of this string and another one.

Note:
Creating a new string by this method usually is less efficient than modifying an existing one (using += or Append).
Parameters:
string The string to be added.
Returns:
The concatenation.

String operator+ const class String String  )  const [inline]
 

Returns the concatenation of this string and another one.

Note:
Creating a new string by this method usually is less efficient than modifying an existing one (using += or Append).
Parameters:
String The string to be added.
Returns:
The concatenation.

String operator+ const class String String  )  const [inline]
 

Returns the concatenation of this string and another one.

Note:
Creating a new string by this method usually is less efficient than modifying an existing one (using += or Append).
Parameters:
String The string to be added.
Returns:
The concatenation.

void operator+= bool  boolean  )  [inline]
 

Adds a boolean string at the end of this string.

Parameters:
boolean The boolean to be added.

void operator+= unsigned long  number  )  [inline]
 

Adds an unsigned long number at the end of this string.

Parameters:
number The number to be added.

void operator+= long  number  )  [inline]
 

Adds a signed long number at the end of this string.

Parameters:
number The number to be added.

void operator+= unsigned int  number  )  [inline]
 

Adds an unsigned int number at the end of this string.

Parameters:
number The number to be added.

void operator+= int  number  )  [inline]
 

Adds a signed int number at the end of this string.

Parameters:
number The number to be added.

void operator+= char  character  )  [inline]
 

Adds a character at the end of this string.

Parameters:
character The character to be added.

void operator+= const char *  string  )  [inline]
 

Adds another string at the end of this one.

Parameters:
string The string to be added.

void operator+= const class String String  )  [inline]
 

Adds another string at the end of this one.

Parameters:
String The string to be added.

void operator+= const class String String  )  [inline]
 

Adds another string at the end of this one.

Parameters:
String The string to be added.

bool operator< const char *  string  )  const [inline]
 

Returns whether this string is less than another one, in terms of the Compare function.

Parameters:
string The other string.
Returns:
Whether this string is less than another one.

bool operator< const class String String  )  const [inline]
 

Returns whether this string is less than another one, in terms of the Compare function.

Parameters:
String The other string.
Returns:
Whether this string is less than another one.

bool operator< const class String String  )  const [inline]
 

Returns whether this string is less than another one, in terms of the Compare function.

Parameters:
String The other string.
Returns:
Whether this string is less than another one.

bool operator<= const char *  string  )  const [inline]
 

Returns whether this string is less than or equals another one, in terms of the Compare function.

Parameters:
string The other string.
Returns:
Whether this string is less than or equals another one.

bool operator<= const class String String  )  const [inline]
 

Returns whether this string is less than or equals another one, in terms of the Compare function.

Parameters:
String The other string.
Returns:
Whether this string is less than or equals another one.

bool operator<= const class String String  )  const [inline]
 

Returns whether this string is less than or equals another one, in terms of the Compare function.

Parameters:
String The other string.
Returns:
Whether this string is less than or equals another one.

void operator= bool  boolean  ) 
 

Sets a boolean string into this string.

Parameters:
boolean The boolean to be set.

void operator= unsigned long  number  ) 
 

Sets an unsigned long number into this string.

Parameters:
number The number to be set.

void operator= long  number  ) 
 

Sets a signed long number into this string.

Parameters:
number The number to be set.

void operator= unsigned int  number  )  [inline]
 

Sets an unsigned int number into this string.

Parameters:
number The number to be set.

void operator= int  number  ) 
 

Sets a signed int number into this string.

Parameters:
number The number to be set.

void operator= char  character  ) 
 

Sets a character into this string.

Parameters:
character The character to be set.

void operator= const char *  string  ) 
 

Sets another string into this one.

Parameters:
string The string to be set.

void operator= const class String String  )  [inline]
 

Sets another string into this one.

Parameters:
String The string to be set.

void operator= const class String String  )  [inline]
 

Sets another string into this one.

Parameters:
String The string to be set.

bool operator== const char *  string  )  const [inline]
 

Returns whether this string equals another one, in terms of the Compare function.

Note:
This operator is the same as the Equals method.
Parameters:
string The other string.
Returns:
Whether this string equals another one.
See also:
Equals()

EqualsIC()

bool operator== const class String String  )  const [inline]
 

Returns whether this string equals another one, in terms of the Compare function.

Note:
This operator is the same as the Equals method.
Parameters:
String The other string.
Returns:
Whether this string equals another one.
See also:
Equals()

EqualsIC()

bool operator== const class String String  )  const [inline]
 

Returns whether this string equals another one, in terms of the Compare function.

Note:
This operator is the same as the Equals method.
Parameters:
String The other string.
Returns:
Whether this string equals another one.
See also:
Equals()

EqualsIC()

bool operator> const char *  string  )  const [inline]
 

Returns whether this string is greater than another one, in terms of the Compare function.

Parameters:
string The other string.
Returns:
Whether this string is greater than another one.

bool operator> const class String String  )  const [inline]
 

Returns whether this string is greater than another one, in terms of the Compare function.

Parameters:
String The other string.
Returns:
Whether this string is greater than another one.

bool operator> const class String String  )  const [inline]
 

Returns whether this string is greater than another one, in terms of the Compare function.

Parameters:
String The other string.
Returns:
Whether this string is greater than another one.

bool operator>= const char *  string  )  const [inline]
 

Returns whether this string is greater than or equals another one, in terms of the Compare function.

Parameters:
string The other string.
Returns:
Whether this string is greater than or equals another one.

bool operator>= const class String String  )  const [inline]
 

Returns whether this string is greater than or equals another one, in terms of the Compare function.

Parameters:
String The other string.
Returns:
Whether this string is greater than or equals another one.

bool operator>= const class String String  )  const [inline]
 

Returns whether this string is greater than or equals another one, in terms of the Compare function.

Parameters:
String The other string.
Returns:
Whether this string is greater than or equals another one.

char operator[] int  index  )  const [inline]
 

Returns a character at a given index of the string.

Parameters:
index The 0-indexed position of the character. It is legal for this parameter to be out of range. In this case, 0 is returned.
Returns:
The character of 0, if the index is out of range.

void Prepend bool  boolean  ) 
 

Prepends a boolean string at the beginning of this string.

Parameters:
boolean The boolean to be prepended.

void Prepend unsigned long  number  ) 
 

Prepends an unsigned long number at the beginning of this string.

Parameters:
number The number to be prepended.

void Prepend long  number  ) 
 

Prepends a signed long number at the beginning of this string.

Parameters:
number The number to be prepended.

void Prepend unsigned int  number  )  [inline]
 

Prepends an unsigned int number at the beginning of this string.

Parameters:
number The number to be prepended.

void Prepend int  number  ) 
 

Prepends a signed int number at the beginning of this string.

Parameters:
number The number to be prepended.

void Prepend char  character  ) 
 

Prepends a character at the beginning of this string.

Parameters:
character The character to be prepended.

void Prepend const char *  string  ) 
 

Prepends another string at the beginning of this one.

Parameters:
string The string to be prepended.

void Prepend const class String String  )  [inline]
 

Prepends another string at the beginning of this one.

Parameters:
String The string to be prepended.

void Prepend const class String String  )  [inline]
 

Prepends another string at the beginning of this one.

Parameters:
String The string to be prepended.

bool ReadFrom FILE *  file  ) 
 

Reads the contents of a given file into this String, using a buffer.

The previous contents of this String object is cleared in advance.

Parameters:
file The file to read from. It will not be closed by this method.
Returns:
Whether the file could be read. If this method returns false, the String is empty afterwards.

bool ReadFrom const char *  fileName,
bool  textMode
 

Reads the contents of a given file into this String, using a buffer.

The previous contents of this String object is cleared in advance.

Parameters:
fileName The name of the file to read from. This method internally opens and closes a FILE object.
textMode Whether to translate CR and LF according to the platform the program is executed on. false disables any translation.
Returns:
Whether the file could be read. If this method returns false, the String is empty afterwards.

void Replace char  character,
char  replacement
 

Finds all occurences of a character in this string and replaces it by another one.

Parameters:
character The character to be searched.
replacement The replacement for the matches.

void Replace const char *  text,
const char *  replacement
 

Finds all occurences of a string in this one and replaces it by another one.

Parameters:
text The text to be searched.
replacement The replacement for the matches.

void Replace const String Text,
const String Replacement
[inline]
 

Finds all occurences of a string in this one and replaces it by another one.

Parameters:
Text The text to be searched.
Replacement The replacement for the matches.

void Replace const String Text,
const String Replacement
[inline]
 

Finds all occurences of a string in this one and replaces it by another one.

Parameters:
Text The text to be searched.
Replacement The replacement for the matches.

bool StartsWith const char *  string  )  const
 

Returns whether another string is part of the start of this string.

Parameters:
string The string to be tested.
Returns:
Whether the given string is part of the start of this string.

bool StartsWith const class String String  )  const [inline]
 

Returns whether another string is part of the start of this string.

Parameters:
String The string to be tested.
Returns:
Whether the given string is part of the start of this string.

bool StartsWith const class String String  )  const [inline]
 

Returns whether another string is part of the start of this string.

Parameters:
String The string to be tested.
Returns:
Whether the given string is part of the start of this string.

bool StartsWithIC const char *  string  )  const
 

Returns whether another string is part of the start of this string, ignoring the case of the two strings.

Parameters:
string The string to be tested.
Returns:
Whether the given string is part of the start of this string.

bool StartsWithIC const class String String  )  const [inline]
 

Returns whether another string is part of the start of this string, ignoring the case of the two strings.

Parameters:
String The string to be tested.
Returns:
Whether the given string is part of the start of this string.

bool StartsWithIC const class String String  )  const [inline]
 

Returns whether another string is part of the start of this string, ignoring the case of the two strings.

Parameters:
String The string to be tested.
Returns:
Whether the given string is part of the start of this string.

String Substring unsigned int  fromIndex  )  const
 

Returns a substring of this one.

Parameters:
fromIndex The position of the first character to include. It is legal for this parameter to be out of range. In this case, an empty string is returned.
Returns:
The substring starting from the index up to the end of the string.

String Substring unsigned int  fromIndex,
unsigned int  length
const
 

Returns a substring of this one.

Parameters:
fromIndex The position of the first character to include. It is legal for this parameter to be out of range. In this case, an empty string is returned.
length The length of the substring to be extracted. It is legal for this parameter to be out of range. In this case, an empty string is returned.
Returns:
The substring.

unsigned char ToLowerCase unsigned char  character  )  [static]
 

Converts a given character to lower case, if it is an upper case character.

All other characters are kept untouched.

Parameters:
character The character to be converted.
Returns:
The converted character.

void ToLowerCase  ) 
 

Converts all upper case characters of this string to lower case.

unsigned char ToUpperCase unsigned char  character  )  [static]
 

Converts a given character to upper case, if it is an lower case character.

All other characters are kept untouched.

Parameters:
character The character to be converted.
Returns:
The converted character.

void ToUpperCase  ) 
 

Converts all lower case characters of this string to upper case.

void Trim  ) 
 

Removes all white space (space, CR, LF, FF, and tab) from the start and the end of this string, but not in the middle.

void TrimLeft  ) 
 

Removes all white space (space, CR, LF, FF, and tab) from the start of this string.

void TrimRight  ) 
 

Removes all white space (space, CR, LF, FF, and tab) from the end of this string.

bool WriteTo FILE *  file  )  [inline]
 

Writes the contents of this String into a given file.

Parameters:
file The file to write to. It will not be closed by this method.
Returns:
Whether the file could be written.

bool WriteTo const char *  fileName,
bool  textMode,
bool  append = false
 

Writes the contents of this String into a given file.

Parameters:
fileName The name of the file to write to. This method internally opens and closes a FILE object.
textMode Whether to translate CR and LF according to the platform the program is executed on. false disables any translation.
append Whether to append to any existing file. If true, the String's contents is appended to the existing file's contents. If false, any existing file is overwritten with the String's contents. In either case, if the file does not exist, it is created.
Returns:
Whether the file could be written.


Member Data Documentation

char* Data [private]
 

The buffer that carries the string data.

The string is always 0 terminated. The size of the allocated memory is contained in the Size attribute. Because the buffer contains the 0 character, it is always larger than the string length.

Definition at line 67 of file String.h.

unsigned int Size [private]
 

The size of the allocated buffer 'Data'.

Definition at line 79 of file String.h.


The documentation for this class was generated from the following file:
Generated on Tue Oct 3 00:23:41 2006 for ToolBox by doxygen 1.3.6