decString Class Reference

Mutable String. More...

#include <decString.h>

List of all members.

Public Member Functions

Constructors and Destructors
 decString ()
 Creates a new empty string.
 decString (const char *string)
 Creates a new string.
 decString (const decString &string)
 Creates a new string being the copy of another string.
 decString (const decString &string1, const decString &string2)
 Creates a new string being the concatenation of two other strings.
 decString (const decString &string1, const char *string2)
 Creates a new string being the concatenation of two other strings.
 ~decString ()
 Cleans up the string.

Management

bool IsEmpty () const
 Determines if the string is empty.
void Empty ()
 Sets the string to the empty string.
int GetLength () const
 Retrieves the number of characters.
int GetAt (int position) const
 Retrieves the character at the given position.
void SetAt (int position, int character)
 Sets the character at the given position.
void Set (const decString &string)
 Sets the string from another string.
void Set (const char *string)
 Sets the string from another string.
void Set (int character, int count)
 Sets the string to a run of characters.
void SetValue (char value)
 Set string to a char value.
void SetValue (unsigned char value)
 Set string to an unsigned char value.
void SetValue (short value)
 Set string to a short value.
void SetValue (unsigned short value)
 Set string to an unsigned short value.
void SetValue (int value)
 Set string to a signed integer value.
void SetValue (unsigned int value)
 Set string to an unsigned integer value.
void SetValue (float value)
 Set string to a float value.
void SetValue (double value)
 Set string to a double value.
void Format (const char *format,...)
 Formats a string using printf style formatting.
void FormatUsing (const char *format, va_list args)
 Formats a string using printf style formatting.
void Append (const decString &string)
 Appends a string.
void Append (const char *string)
 Appends a string.
void AppendCharacter (char character)
 Appends a character.
void AppendCharacter (unsigned char character)
void AppendCharacter (int character)
void AppendValue (char value)
 Appends a char value.
void AppendValue (unsigned char value)
 Appends an unsigned char value.
void AppendValue (short value)
 Appends a short value.
void AppendValue (unsigned short value)
 Appends an unsigned short value.
void AppendValue (int value)
 Appends a signed integer value.
void AppendValue (unsigned int value)
 Appends an unsigned integer value.
void AppendValue (float value)
 Appends a float value.
void AppendValue (double value)
 Appends a double value.
void AppendFormat (const char *format,...)
 Appends a formatted string using printf style formatting.
void AppendFormatUsing (const char *format, va_list args)
 Appends a formatted string using printf style formatting.
int ToInt () const
 Retrieves integer value.
long long ToLong () const
 Retrieves the long int value.
float ToFloat () const
 Retrieves float value.
double ToDouble () const
 Retrieves double value.
const char * GetString () const
 Retrieves the pointer to the text.
bool Equals (const decString &string) const
 Determines if the string equals another string case sensitive.
bool Equals (const char *string) const
 Determines if the string equals another string case sensitive.
bool EqualsInsensitive (const decString &string) const
 Determines if the string equals another string case insensitive.
bool EqualsInsensitive (const char *string) const
 Determines if the string equals another string case insensitive.
int Compare (const decString &string) const
 Compares the string to another string case sensitive returns -1(less), 0(equal) or 1(greater).
int Compare (const char *string) const
 Compares the string to another string case sensitive returns -1(less), 0(equal) or 1(greater).
int CompareInsensitive (const decString &string) const
 Compares the string to another string case insensitive returns -1(less), 0(equal) or 1(greater).
int CompareInsensitive (const char *string) const
 Compares the string to another string case insensitive returns -1(less), 0(equal) or 1(greater).
bool MatchesPattern (const decString &pattern) const
 Determines if this string matches a given pattern.
bool MatchesPattern (const char *pattern) const
 Determines if this string matches a given pattern.
bool operator! () const
 Determines if the string is empty.
bool operator== (const decString &string) const
 Determines if the string equals another string case sensitive.
bool operator== (const char *string) const
 Determines if the string equals another string case sensitive.
bool operator!= (const decString &string) const
 Determines if the string equals another string case sensitive.
bool operator!= (const char *string) const
 Determines if the string equals another string case sensitive.
bool operator< (const decString &string) const
 Determines if the string is lexographically less than another string case sensitive.
bool operator< (const char *string) const
 Determines if the string is lexographically less than another string case sensitive.
bool operator<= (const decString &string) const
 Determines if the string is lexographically less than or equal to another string case sensitive.
bool operator<= (const char *string) const
 Determines if the string is lexographically less than or equal to another string case sensitive.
bool operator> (const decString &string) const
 Determines if the string is lexographically greater than another string case sensitive.
bool operator> (const char *string) const
 Determines if the string is lexographically greater than another string case sensitive.
bool operator>= (const decString &string) const
 Determines if the string is lexographically greater than or equal to another string case sensitive.
bool operator>= (const char *string) const
 Determines if the string is lexographically greater than or equal to another string case sensitive.
decString operator+ (const decString &string) const
 Returns a new string being the concatenation of this string and another string.
decString operator+ (const char *string) const
 Returns a new string being the concatenation of this string and another string.
decStringoperator= (const decString &string)
 Sets the string to another string.
decStringoperator= (const char *string)
 Sets the string to another string.
decStringoperator+= (const decString &string)
 Appends a string to this string.
decStringoperator+= (const char *string)
 Appends a string to this string.
 operator const char * () const
 Retrieves the character pointer.
static bool StringMatchesPattern (const char *string, const char *pattern)
 Determines if a string matches a given pattern.

Detailed Description

Mutable String.

Stores a 0 terminated, mutable, ASCII character string. This class is designed for storing short strings without large overhead. For this only the string pointer is stored. All operations required to know the length of the string have to calculate it whenever needed. Therefore if you need to do text operations on a larger string use the StringBuffer class instead which stores a string length and can handle 0 characters inside the string.

Author:
Plüss Roland
Version:
1.0
Date:
2010

Constructor & Destructor Documentation

decString::decString (  )

Creates a new empty string.

decString::decString ( const char *  string )

Creates a new string.

decString::decString ( const decString string )

Creates a new string being the copy of another string.

decString::decString ( const decString string1,
const decString string2 
)

Creates a new string being the concatenation of two other strings.

decString::decString ( const decString string1,
const char *  string2 
)

Creates a new string being the concatenation of two other strings.

decString::~decString (  )

Cleans up the string.


Member Function Documentation

void decString::Append ( const decString string )

Appends a string.

void decString::Append ( const char *  string )

Appends a string.

void decString::AppendCharacter ( char  character )

Appends a character.

void decString::AppendCharacter ( unsigned char  character )
void decString::AppendCharacter ( int  character )
void decString::AppendFormat ( const char *  format,
  ... 
)

Appends a formatted string using printf style formatting.

void decString::AppendFormatUsing ( const char *  format,
va_list  args 
)

Appends a formatted string using printf style formatting.

void decString::AppendValue ( char  value )

Appends a char value.

void decString::AppendValue ( unsigned char  value )

Appends an unsigned char value.

void decString::AppendValue ( short  value )

Appends a short value.

void decString::AppendValue ( unsigned short  value )

Appends an unsigned short value.

void decString::AppendValue ( int  value )

Appends a signed integer value.

void decString::AppendValue ( unsigned int  value )

Appends an unsigned integer value.

void decString::AppendValue ( float  value )

Appends a float value.

void decString::AppendValue ( double  value )

Appends a double value.

int decString::Compare ( const decString string ) const

Compares the string to another string case sensitive returns -1(less), 0(equal) or 1(greater).

int decString::Compare ( const char *  string ) const

Compares the string to another string case sensitive returns -1(less), 0(equal) or 1(greater).

int decString::CompareInsensitive ( const decString string ) const

Compares the string to another string case insensitive returns -1(less), 0(equal) or 1(greater).

int decString::CompareInsensitive ( const char *  string ) const

Compares the string to another string case insensitive returns -1(less), 0(equal) or 1(greater).

void decString::Empty (  )

Sets the string to the empty string.

bool decString::Equals ( const decString string ) const

Determines if the string equals another string case sensitive.

bool decString::Equals ( const char *  string ) const

Determines if the string equals another string case sensitive.

bool decString::EqualsInsensitive ( const decString string ) const

Determines if the string equals another string case insensitive.

bool decString::EqualsInsensitive ( const char *  string ) const

Determines if the string equals another string case insensitive.

void decString::Format ( const char *  format,
  ... 
)

Formats a string using printf style formatting.

void decString::FormatUsing ( const char *  format,
va_list  args 
)

Formats a string using printf style formatting.

int decString::GetAt ( int  position ) const

Retrieves the character at the given position.

int decString::GetLength (  ) const

Retrieves the number of characters.

const char* decString::GetString (  ) const

Retrieves the pointer to the text.

bool decString::IsEmpty (  ) const

Determines if the string is empty.

bool decString::MatchesPattern ( const decString pattern ) const

Determines if this string matches a given pattern.

bool decString::MatchesPattern ( const char *  pattern ) const

Determines if this string matches a given pattern.

decString::operator const char * (  ) const

Retrieves the character pointer.

bool decString::operator! (  ) const

Determines if the string is empty.

bool decString::operator!= ( const decString string ) const

Determines if the string equals another string case sensitive.

bool decString::operator!= ( const char *  string ) const

Determines if the string equals another string case sensitive.

decString decString::operator+ ( const char *  string ) const

Returns a new string being the concatenation of this string and another string.

decString decString::operator+ ( const decString string ) const

Returns a new string being the concatenation of this string and another string.

decString& decString::operator+= ( const char *  string )

Appends a string to this string.

decString& decString::operator+= ( const decString string )

Appends a string to this string.

bool decString::operator< ( const decString string ) const

Determines if the string is lexographically less than another string case sensitive.

bool decString::operator< ( const char *  string ) const

Determines if the string is lexographically less than another string case sensitive.

bool decString::operator<= ( const decString string ) const

Determines if the string is lexographically less than or equal to another string case sensitive.

bool decString::operator<= ( const char *  string ) const

Determines if the string is lexographically less than or equal to another string case sensitive.

decString& decString::operator= ( const char *  string )

Sets the string to another string.

decString& decString::operator= ( const decString string )

Sets the string to another string.

bool decString::operator== ( const decString string ) const

Determines if the string equals another string case sensitive.

bool decString::operator== ( const char *  string ) const

Determines if the string equals another string case sensitive.

bool decString::operator> ( const decString string ) const

Determines if the string is lexographically greater than another string case sensitive.

bool decString::operator> ( const char *  string ) const

Determines if the string is lexographically greater than another string case sensitive.

bool decString::operator>= ( const char *  string ) const

Determines if the string is lexographically greater than or equal to another string case sensitive.

bool decString::operator>= ( const decString string ) const

Determines if the string is lexographically greater than or equal to another string case sensitive.

void decString::Set ( const char *  string )

Sets the string from another string.

void decString::Set ( int  character,
int  count 
)

Sets the string to a run of characters.

void decString::Set ( const decString string )

Sets the string from another string.

void decString::SetAt ( int  position,
int  character 
)

Sets the character at the given position.

void decString::SetValue ( unsigned short  value )

Set string to an unsigned short value.

void decString::SetValue ( char  value )

Set string to a char value.

void decString::SetValue ( short  value )

Set string to a short value.

void decString::SetValue ( unsigned int  value )

Set string to an unsigned integer value.

void decString::SetValue ( unsigned char  value )

Set string to an unsigned char value.

void decString::SetValue ( double  value )

Set string to a double value.

void decString::SetValue ( int  value )

Set string to a signed integer value.

void decString::SetValue ( float  value )

Set string to a float value.

static bool decString::StringMatchesPattern ( const char *  string,
const char *  pattern 
) [static]

Determines if a string matches a given pattern.

double decString::ToDouble (  ) const

Retrieves double value.

float decString::ToFloat (  ) const

Retrieves float value.

int decString::ToInt (  ) const

Retrieves integer value.

long long decString::ToLong (  ) const

Retrieves the long int value.


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