xvr2::String Class Reference

#include <String.h>

Inheritance diagram for xvr2::String:

Inheritance graph
[legend]

List of all members.


Detailed Description

The String class!!! This a string treatment class, it has a lot of methods and the main idea is eliminate de use of the common tricks we use everyday while we work with strings.

Many times when we work with strings we leave BIG memory leaks in our programs, the main idea here is to help the programmer by providing here a very complete strig treatment tool for everyday use.

Definition at line 29 of file String.h.


Public Member Functions

 String ()
 Mandatory Default constructor.
 String (const String &s)
 Instantiates a String object by copying another.
 String (const char *s)
 Instantiates an String object by copying an array of characters.
 String (const Int32 n)
 Instantiates an String object from a numeric data-type.
 String (const UInt32 n)
 Instantiates an String object from a numeric data-type.
 String (const Int64 n)
 Instantiates an String object from a numeric data-type.
 String (const UInt64 n)
 Instantiates an String object from a numeric data-type.
 String (const float n)
 Instantiates an String object from a floating-point data-type.
 String (const double n)
 Instantiates an String object from a floating-point data-type.
 String (const long double n)
 Instantiates an String object from a floating-point data-type.
 String (const std::string &s)
 Instantiates a String object from a std::string object.
 String (const std::string *s)
 Instantiates a String object from a std::string object.
 String (const xvr2::Object &o)
Stringassign (const Int32 n)
 Transforms the given argument and sets it to the current String.
Stringassign (const Int64 n)
 Transforms the given argument and sets it to the current String.
Stringassign (const UInt32 n)
 Transforms the given argument and sets it to the current String.
Stringassign (const UInt64 n)
 Transforms the given argument and sets it to the current String.
Stringassign (const float n)
 Transforms the given argument and sets it to the current String.
Stringassign (const double n)
 Transforms the given argument and sets it to the current String.
Stringassign (const long double n)
 Transforms the given argument and sets it to the current String.
Stringassign (const char c)
 Replaces the contents of the String with the given character.
Stringassign (const char *sstr)
 Replaces the contents of the String with the given array of characters.
Stringassign (const std::string *s)
 Replaces the contents of the String with the contents of the given std::string object.
Stringassign (const String &sstr)
 Replaces the contents of the String with the contents of another String object.
Stringconcat (const char *s)
 Concatenates (appends) the given argument to the contents of the String.
Stringconcat (const char c)
 Concatenates (appends) the given argument to the contents of the String.
Stringconcat (const String &s)
 Concatenates (appends) the given argument to the contents of the String.
Stringconcat (const Int32 n)
 Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.
Stringconcat (const Int64 n)
 Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.
Stringconcat (const UInt32 n)
 Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.
Stringconcat (const UInt64 n)
 Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.
Stringconcat (const float n)
 Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.
Stringconcat (const double n)
 Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.
Stringconcat (const long double n)
 Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.
Stringoperator= (const Int32 n)
 Same as the String::assign methods.
Stringoperator= (const UInt32 n)
 Same as the String::assign methods.
Stringoperator= (const Int64 n)
 Same as the String::assign methods.
Stringoperator= (const UInt64 n)
 Same as the String::assign methods.
Stringoperator= (const float n)
 Same as the String::assign methods.
Stringoperator= (const double n)
 Same as the String::assign methods.
Stringoperator= (const long double n)
 Same as the String::assign methods.
Stringoperator= (const String &s)
 Same as the String::assign methods.
const Stringoperator+= (const String &s)
const Stringoperator+= (const Int32 n)
 Same as the String::concat methods.
const Stringoperator+= (const UInt32 n)
 Same as the String::concat methods.
const Stringoperator+= (const Int64 n)
 Same as the String::concat methods.
const Stringoperator+= (const UInt64 n)
 Same as the String::concat methods.
const Stringoperator+= (const float n)
 Same as the String::concat methods.
const Stringoperator+= (const double n)
 Same as the String::concat methods.
const Stringoperator+= (const long double n)
 Same as the String::concat methods.
const StringtoUpperCase ()
 Transforms all characters to uppercase.
const StringtoLowerCase ()
 Transforms all characters to lowercase.
const int toInt ()
 Converts the string contents to an integer if possible.
const unsigned int toUInt ()
 Converts the string contents to an unsigned integer if possible.
const float toFloat ()
 Transforms the contents of the string to a float if the string can't be translated to a number then the exception NumberException is thrown.
const double toDouble ()
 Transforms the contents of the string to a double if the string can't be translated to a number then the exception NumberException is thrown.
const long double toLongDouble ()
 Transforms the contents of the string to a long double if the string can't be translated to a number then the exception NumberException is thrown.
const Int64 toInt64 ()
 Transforms the contents of the string to a Int64 if the string can't be translated to a number then the exception NumberException is thrown.
const bool operator== (const Int32 n)
 Same as the String::equals methods.
const bool operator== (const UInt32 n)
 Same as the String::equals methods.
const bool operator== (const Int64 n)
 Same as the String::equals methods.
const bool operator== (const UInt64 n)
 Same as the String::equals methods.
const bool operator== (const float n)
 Same as the String::equals methods.
const bool operator== (const double n)
 Same as the String::equals methods.
const bool operator== (const long double n)
 Same as the String::equals methods.
const bool operator!= (const Int32 n)
 Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.
const bool operator!= (const UInt32 n)
 Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.
const bool operator!= (const Int64 n)
 Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.
const bool operator!= (const UInt64 n)
 Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.
const bool operator!= (const float n)
 Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.
const bool operator!= (const double n)
 Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.
const bool operator!= (const long double n)
 Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.
int compare (const String &s) const
 Performs a lexicographic comparison between two String.
bool equals (const char c) const
 Verifies if the String contents are the same as textual form of the given argument.
bool equals (const String &s) const
 Tells wheter two String have the same contents.
bool equals (const String &s)
 Tells wheter two String have the same contents.
const bool equals (const Int32 n)
 Verifies if the String contents are the same as textual form of the given argument.
const bool equals (const UInt32 n)
 Verifies if the String contents are the same as textual form of the given argument.
const bool equals (const Int64 n)
 Verifies if the String contents are the same as textual form of the given argument.
const bool equals (const UInt64 n)
 Verifies if the String contents are the same as textual form of the given argument.
const bool equals (const float n)
 Verifies if the String contents are the same as textual form of the given argument.
const bool equals (const double n)
 Verifies if the String contents are the same as textual form of the given argument.
const bool equals (const long double n)
 Verifies if the String contents are the same as textual form of the given argument.
bool startsIWith (const char *s) const
 Tells if the string starts with the given substring regardless of its case (upper or lower).
bool startsWith (const String &s) const
 Tells if the string starts with the given substring taking care that each character case matches.
bool endsIWith (const char *s) const
 Tells if the string ends with the given substring regardless of its case (upper or lower).
bool endsWith (const String &s) const
 Tells if the string ends with the given substring taking care that each character case matches.
String getSubstr (int start, int end)
 Lets you retrieve a substring from the current string.
virtual std::string toString ()
 Converts this String to a std::string.
void eat (const char *data, int len)
 Will append an arbitrary amount characters from the given array.
virtual StringtrimLeft (const char c= ' ')
 Erases all contiguous occurrences of a specified character from the beginning of the string to the right.
virtual StringtrimRight (const char c= ' ')
 Erases all contiguous occurrences of a specified character from the end of the string to the left.
virtual int index (const char *s)
 Returns the location (from left to right) of the first ocurrence of s.
virtual int index (const char *s) const
 Returns the location (from left to right) of the first ocurrence of s.
virtual int index (const BasicString< char > &s)
 Returns the location (from left to right) of the first ocurrence of s.
virtual int rindex (const char *s)
 Returns the location (from right to left) of the first ocurrence of s.
virtual int rindex (const char *s) const
 Returns the location (from right to left) of the first ocurrence of s.
virtual int rindex (const BasicString< char > &s)
 Returns the location (from right to left) of the first ocurrence of s.
BasicString< char > & biteLeft (UInt32 howmany=1)
 Erases an amount of characters starting from the left.
BasicString< char > & biteRight (UInt32 howmany=1)
 Erases an amount of characters starting from right to left.
BasicString< char > & deleteFirst ()
 Erases the first character from the string itself.
BasicString< char > & deleteLast ()
 Erases the last character from the string itself.
virtual BasicString< char > & trim (const charc= ' ')
 Combines BasicString::trimLeft and BasicString::trimRight.
virtual bool equals (const char *s)
 Verifies if the string is EXACTLY the same as the given argument.
virtual bool equals (const BasicString< char > &s)
 Verifies if the string is EXACTLY the same as the given argument.
virtual bool equals (const BasicString< char > &s) const
 Verifies if the string is EXACTLY the same as the given argument.
virtual bool operator== (const char *s)
 Verifies if the string is EXACTLY the same as the given argument.
virtual bool operator== (const BasicString< char > &s)
 Verifies if the string is EXACTLY the same as the given argument.
void deleteString ()
 Deletes the string contents.
const char * toCharPtr () const
 Converts the string to an array of characters.
const char * toCharPtr ()
 Converts the string to an array of characters.
const char charAt (int i) const
 Gets the character located at the given position.
const char charAt (int i)
 Gets the character located at the given position.
const char operator[] (int i)
 Gets the character located at the given position.
const char operator[] (int i) const
 Gets the character located at the given position.
bool startsWith (const char *s) const
 Tells if the string starts with the given substring.
bool endsWith (const char *s) const
 Tells if the string ends with the given substring.
BasicString< char > & deleteCharAt (int pos)
 Erases a character at the given position.
BasicString< char > & insertCharAt (const int pos, const charc)
 Insert a specifig character at the given position.
BasicString< char > & replace (const charfrom, const char *to)
 Replaces all occurrences of a character with the given character array.
virtual const char * getClassName ()
 Returns the name of the current class.

Static Public Member Functions

static void debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)
 Will print a debug message to the screen.
static void debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)

Protected Attributes

std::string __cls_name

Friends

std::ostream & operator<< (std::ostream &stream, const String &s)
 Lets you send the contents of a String an std::ostream.
std::ostream & operator<< (std::ostream &stream, const Object &s)

Constructor & Destructor Documentation

xvr2::String::String (  ) 

Mandatory Default constructor.

xvr2::String::String ( const String s  ) 

Instantiates a String object by copying another.

Parameters:
s The String to be copied

xvr2::String::String ( const char *  s  ) 

Instantiates an String object by copying an array of characters.

Parameters:
s A null-terminated array of characters to be copied

xvr2::String::String ( const Int32  n  ) 

Instantiates an String object from a numeric data-type.

This method will try to convert the given argument to a valid string equivalent.

Parameters:
n An Int32 integer.

xvr2::String::String ( const UInt32  n  ) 

Instantiates an String object from a numeric data-type.

This method will try to convert the given argument to a valid string equivalent.

Parameters:
n An UInt32 integer.

xvr2::String::String ( const Int64  n  ) 

Instantiates an String object from a numeric data-type.

This method will try to convert the given argument to a valid string equivalent.

Parameters:
n An Int64 integer.

xvr2::String::String ( const UInt64  n  ) 

Instantiates an String object from a numeric data-type.

This method will try to convert the given argument to a valid string equivalent.

Parameters:
n An UInt64 integer.

xvr2::String::String ( const float  n  ) 

Instantiates an String object from a floating-point data-type.

This method will try to convert the given argument to a valid string equivalent.

Parameters:
n The float number.

xvr2::String::String ( const double  n  ) 

Instantiates an String object from a floating-point data-type.

This method will try to convert the given argument to a valid string equivalent.

Parameters:
n The double number.

xvr2::String::String ( const long double  n  ) 

Instantiates an String object from a floating-point data-type.

This method will try to convert the given argument to a valid string equivalent.

Parameters:
n The long double number.

xvr2::String::String ( const std::string &  s  ) 

Instantiates a String object from a std::string object.

Parameters:
s The String to be copied

xvr2::String::String ( const std::string *  s  ) 

Instantiates a String object from a std::string object.

Parameters:
s The String to be copied

xvr2::String::String ( const xvr2::Object o  ) 


Member Function Documentation

String& xvr2::String::assign ( const Int32  n  ) 

Transforms the given argument and sets it to the current String.

Parameters:
n The numeric value to be converted.
Returns:
A reference to the current String object after modified.

String& xvr2::String::assign ( const Int64  n  ) 

Transforms the given argument and sets it to the current String.

Parameters:
n The numeric value to be converted.
Returns:
A reference to the current String object after modified.

String& xvr2::String::assign ( const UInt32  n  ) 

Transforms the given argument and sets it to the current String.

Parameters:
n The numeric value to be converted.
Returns:
A reference to the current String object after modified.

String& xvr2::String::assign ( const UInt64  n  ) 

Transforms the given argument and sets it to the current String.

Parameters:
n The numeric value to be converted.
Returns:
A reference to the current String object after modified.

String& xvr2::String::assign ( const float  n  ) 

Transforms the given argument and sets it to the current String.

Parameters:
n The numeric value to be converted.
Returns:
A reference to the current String object after modified.

String& xvr2::String::assign ( const double  n  ) 

Transforms the given argument and sets it to the current String.

Parameters:
n The numeric value to be converted.
Returns:
A reference to the current String object after modified.

String& xvr2::String::assign ( const long double  n  ) 

Transforms the given argument and sets it to the current String.

Parameters:
n The numeric value to be converted.
Returns:
A reference to the current String object after modified.

String& xvr2::String::assign ( const char  c  ) 

Replaces the contents of the String with the given character.

Parameters:
c The character to use.
Returns:
A reference to the current String object after modified.

String& xvr2::String::assign ( const char *  sstr  ) 

Replaces the contents of the String with the given array of characters.

Parameters:
sstr The array of characters to use.
Returns:
A reference to the current String object after modified.

String& xvr2::String::assign ( const std::string *  s  ) 

Replaces the contents of the String with the contents of the given std::string object.

Parameters:
s A pointer to a std::string object.
Returns:
A reference to the current String object after modified.

String& xvr2::String::assign ( const String sstr  ) 

Replaces the contents of the String with the contents of another String object.

Parameters:
sstr A reference to the String to be copied.
Returns:
A reference to the current String object after modified.

String& xvr2::String::concat ( const char *  s  ) 

Concatenates (appends) the given argument to the contents of the String.

Parameters:
s An array of characters
Returns:
A reference to the current String object after modified.

String& xvr2::String::concat ( const char  c  ) 

Concatenates (appends) the given argument to the contents of the String.

Parameters:
c A single character.
Returns:
A reference to the current String object after modified.

String& xvr2::String::concat ( const String s  ) 

Concatenates (appends) the given argument to the contents of the String.

Parameters:
s An String.
Returns:
A reference to the current String object after modified.

String& xvr2::String::concat ( const Int32  n  ) 

Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.

Parameters:
n An Int32 number.
Returns:
A reference to the current String object after modified.

String& xvr2::String::concat ( const Int64  n  ) 

Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.

Parameters:
n An Int64 number.
Returns:
A reference to the current String object after modified.

String& xvr2::String::concat ( const UInt32  n  ) 

Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.

Parameters:
n An UInt32 number.
Returns:
A reference to the current String object after modified.

String& xvr2::String::concat ( const UInt64  n  ) 

Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.

Parameters:
n An UInt64 number.
Returns:
A reference to the current String object after modified.

String& xvr2::String::concat ( const float  n  ) 

Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.

Parameters:
n A float number.
Returns:
A reference to the current String object after modified.

String& xvr2::String::concat ( const double  n  ) 

Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.

Parameters:
n A double number.
Returns:
A reference to the current String object after modified.

String& xvr2::String::concat ( const long double  n  ) 

Concatenates (appends) the given numeric argument (after transforming it) to the contents of the String.

Parameters:
n A long double number.
Returns:
A reference to the current String object after modified.

String& xvr2::String::operator= ( const Int32  n  ) 

Same as the String::assign methods.

See also:
String::assign.

String& xvr2::String::operator= ( const UInt32  n  ) 

Same as the String::assign methods.

See also:
String::assign.

String& xvr2::String::operator= ( const Int64  n  ) 

Same as the String::assign methods.

See also:
String::assign.

String& xvr2::String::operator= ( const UInt64  n  ) 

Same as the String::assign methods.

See also:
String::assign.

String& xvr2::String::operator= ( const float  n  ) 

Same as the String::assign methods.

See also:
String::assign.

String& xvr2::String::operator= ( const double  n  ) 

Same as the String::assign methods.

See also:
String::assign.

String& xvr2::String::operator= ( const long double  n  ) 

Same as the String::assign methods.

See also:
String::assign.

String& xvr2::String::operator= ( const String s  ) 

Same as the String::assign methods.

See also:
String::assign.

const String& xvr2::String::operator+= ( const String s  ) 

const String& xvr2::String::operator+= ( const Int32  n  ) 

Same as the String::concat methods.

See also:
String::concat.

const String& xvr2::String::operator+= ( const UInt32  n  ) 

Same as the String::concat methods.

See also:
String::concat.

const String& xvr2::String::operator+= ( const Int64  n  ) 

Same as the String::concat methods.

See also:
String::concat.

const String& xvr2::String::operator+= ( const UInt64  n  ) 

Same as the String::concat methods.

See also:
String::concat.

const String& xvr2::String::operator+= ( const float  n  ) 

Same as the String::concat methods.

See also:
String::concat.

const String& xvr2::String::operator+= ( const double  n  ) 

Same as the String::concat methods.

See also:
String::concat.

const String& xvr2::String::operator+= ( const long double  n  ) 

Same as the String::concat methods.

See also:
String::concat.

const String& xvr2::String::toUpperCase (  ) 

Transforms all characters to uppercase.

Returns:
A reference to the current String object after modified.

const String& xvr2::String::toLowerCase (  ) 

Transforms all characters to lowercase.

Returns:
A reference to the current String object after modified.

const int xvr2::String::toInt (  ) 

Converts the string contents to an integer if possible.

Exceptions:
xvr2::NumberException if the String couldn't be converted.
Returns:
The converted integer.

const unsigned int xvr2::String::toUInt (  ) 

Converts the string contents to an unsigned integer if possible.

Exceptions:
xvr2::NumberException if the String couldn't be converted.
Returns:
The converted unsigned integer.

const float xvr2::String::toFloat (  ) 

Transforms the contents of the string to a float if the string can't be translated to a number then the exception NumberException is thrown.

const double xvr2::String::toDouble (  ) 

Transforms the contents of the string to a double if the string can't be translated to a number then the exception NumberException is thrown.

const long double xvr2::String::toLongDouble (  ) 

Transforms the contents of the string to a long double if the string can't be translated to a number then the exception NumberException is thrown.

const Int64 xvr2::String::toInt64 (  ) 

Transforms the contents of the string to a Int64 if the string can't be translated to a number then the exception NumberException is thrown.

const bool xvr2::String::operator== ( const Int32  n  ) 

Same as the String::equals methods.

const bool xvr2::String::operator== ( const UInt32  n  ) 

Same as the String::equals methods.

const bool xvr2::String::operator== ( const Int64  n  ) 

Same as the String::equals methods.

const bool xvr2::String::operator== ( const UInt64  n  ) 

Same as the String::equals methods.

const bool xvr2::String::operator== ( const float  n  ) 

Same as the String::equals methods.

const bool xvr2::String::operator== ( const double  n  ) 

Same as the String::equals methods.

const bool xvr2::String::operator== ( const long double  n  ) 

Same as the String::equals methods.

const bool xvr2::String::operator!= ( const Int32  n  ) 

Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.

Parameters:
n An Int32 whose textual form will be used for comparison.
Returns:
true If they are NOT equal, false if they are.

const bool xvr2::String::operator!= ( const UInt32  n  ) 

Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.

Parameters:
n An UInt32 whose textual form will be used for comparison.
Returns:
true If they are NOT equal, false if they are.

const bool xvr2::String::operator!= ( const Int64  n  ) 

Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.

Parameters:
n An Int64 whose textual form will be used for comparison.
Returns:
true If they are NOT equal, false if they are.

const bool xvr2::String::operator!= ( const UInt64  n  ) 

Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.

Parameters:
n An UInt64 whose textual form will be used for comparison.
Returns:
true If they are NOT equal, false if they are.

const bool xvr2::String::operator!= ( const float  n  ) 

Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.

Parameters:
n A float whose textual form will be used for comparison.
Returns:
true If they are NOT equal, false if they are.

const bool xvr2::String::operator!= ( const double  n  ) 

Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.

Parameters:
n A double whose textual form will be used for comparison.
Returns:
true If they are NOT equal, false if they are.

const bool xvr2::String::operator!= ( const long double  n  ) 

Inequality operator, compares if the "textual" form of the given argument is not the same as the String contents.

Parameters:
n A long double whose textual form will be used for comparison.
Returns:
true If they are NOT equal, false if they are.

int xvr2::String::compare ( const String s  )  const

Performs a lexicographic comparison between two String.

Parameters:
s The String to be compared with.
Returns:
0 if their contents are the same, less than zero if if the current String length is less than the lenght of s, in any other case returns a positive number.

bool xvr2::String::equals ( const char  c  )  const

Verifies if the String contents are the same as textual form of the given argument.

Parameters:
c A character to be compared with.
Returns:
true if both are equal, false if not.

bool xvr2::String::equals ( const String s  )  const

Tells wheter two String have the same contents.

Parameters:
s A String to be compared with.
Returns:
true if both are equal, false if not.

bool xvr2::String::equals ( const String s  ) 

Tells wheter two String have the same contents.

Parameters:
s A String to be compared with.
Returns:
true if both are equal, false if not.

const bool xvr2::String::equals ( const Int32  n  ) 

Verifies if the String contents are the same as textual form of the given argument.

Parameters:
n An Int32 to be compared with.
Returns:
true if both are equal, false if not.

const bool xvr2::String::equals ( const UInt32  n  ) 

Verifies if the String contents are the same as textual form of the given argument.

Parameters:
n An UInt32 to be compared with.
Returns:
true if both are equal, false if not.

const bool xvr2::String::equals ( const Int64  n  ) 

Verifies if the String contents are the same as textual form of the given argument.

Parameters:
n An Int64 to be compared with.
Returns:
true if both are equal, false if not.

const bool xvr2::String::equals ( const UInt64  n  ) 

Verifies if the String contents are the same as textual form of the given argument.

Parameters:
n An UInt64 to be compared with.
Returns:
true if both are equal, false if not.

const bool xvr2::String::equals ( const float  n  ) 

Verifies if the String contents are the same as textual form of the given argument.

Parameters:
n A float to be compared with.
Returns:
true if both are equal, false if not.

const bool xvr2::String::equals ( const double  n  ) 

Verifies if the String contents are the same as textual form of the given argument.

Parameters:
n A double to be compared with.
Returns:
true if both are equal, false if not.

const bool xvr2::String::equals ( const long double  n  ) 

Verifies if the String contents are the same as textual form of the given argument.

Parameters:
n A long double to be compared with.
Returns:
true if both are equal, false if not.

bool xvr2::String::startsIWith ( const char *  s  )  const

Tells if the string starts with the given substring regardless of its case (upper or lower).

Parameters:
s substring to look at the beginning.
Returns:
true if the string starts with the specified substring, false otherwise.

bool xvr2::String::startsWith ( const String s  )  const

Tells if the string starts with the given substring taking care that each character case matches.

Parameters:
s substring to look at the beginning.
Returns:
true if the string starts with the specified substring, false otherwise.

bool xvr2::String::endsIWith ( const char *  s  )  const

Tells if the string ends with the given substring regardless of its case (upper or lower).

Parameters:
s substring to look at the end.
Returns:
true if the string ends with the specified substring, false otherwise.

bool xvr2::String::endsWith ( const String s  )  const

Tells if the string ends with the given substring taking care that each character case matches.

Parameters:
s substring to look at the end.
Returns:
true if the string ends with the specified substring, false otherwise.

String xvr2::String::getSubstr ( int  start,
int  end 
)

Lets you retrieve a substring from the current string.

Parameters:
start The position where the initial part of the substring we want to extract is located at.
end The position at where the last character from our substring is located at.
Returns:
The extracted substring.

Reimplemented from xvr2::BasicString< char >.

virtual std::string xvr2::String::toString (  )  [virtual]

Converts this String to a std::string.

Returns:
A std:string equivalent to this String.

Reimplemented from xvr2::Object.

void xvr2::String::eat ( const char *  data,
int  len 
)

Will append an arbitrary amount characters from the given array.

Parameters:
data The array from where we will be copying,
len The amount of chars to be copied from there.

virtual String& xvr2::String::trimLeft ( const char  c = ' '  )  [virtual]

Erases all contiguous occurrences of a specified character from the beginning of the string to the right.

Parameters:
c The character to look for and erase.
Returns:
A reference to string after modified.

Reimplemented from xvr2::BasicString< char >.

virtual String& xvr2::String::trimRight ( const char  c = ' '  )  [virtual]

Erases all contiguous occurrences of a specified character from the end of the string to the left.

Parameters:
c The character to look for and erase.
Returns:
A reference to string after modified.

Reimplemented from xvr2::BasicString< char >.

virtual int xvr2::BasicString< char >::index ( const char *  s  )  [inline, virtual, inherited]

Returns the location (from left to right) of the first ocurrence of s.

Parameters:
s The substring to search for.
Returns:
The position where the substring is or BasicString::npos if the substring was not contained in the string itself.

Definition at line 42 of file BasicString.h.

virtual int xvr2::BasicString< char >::index ( const char *  s  )  const [inline, virtual, inherited]

Returns the location (from left to right) of the first ocurrence of s.

Parameters:
s The substring to search for.
Returns:
The position where the substring is or BasicString::npos if the substring was not contained in the string itself.

Definition at line 51 of file BasicString.h.

virtual int xvr2::BasicString< char >::index ( const BasicString< char > &  s  )  [inline, virtual, inherited]

Returns the location (from left to right) of the first ocurrence of s.

Parameters:
s The substring to search for.
Returns:
The position where the substring is or BasicString::npos if the substring was not contained in the string itself.

Definition at line 60 of file BasicString.h.

virtual int xvr2::BasicString< char >::rindex ( const char *  s  )  [inline, virtual, inherited]

Returns the location (from right to left) of the first ocurrence of s.

Parameters:
s The substring to search for.
Returns:
The position where the substring is or BasicString::npos if the substring was not contained in the string itself.

Definition at line 69 of file BasicString.h.

virtual int xvr2::BasicString< char >::rindex ( const char *  s  )  const [inline, virtual, inherited]

Returns the location (from right to left) of the first ocurrence of s.

Parameters:
s The substring to search for.
Returns:
The position where the substring is or BasicString::npos if the substring was not contained in the string itself.

Definition at line 78 of file BasicString.h.

virtual int xvr2::BasicString< char >::rindex ( const BasicString< char > &  s  )  [inline, virtual, inherited]

Returns the location (from right to left) of the first ocurrence of s.

Parameters:
s The substring to search for.
Returns:
The position where the substring is or BasicString::npos if the substring was not contained in the string itself.

Definition at line 87 of file BasicString.h.

BasicString<char >& xvr2::BasicString< char >::biteLeft ( UInt32  howmany = 1  )  [inline, inherited]

Erases an amount of characters starting from the left.

Parameters:
howmany The amount of chars to be deleted from the beginning of the string.
Returns:
A reference to string after modified.

Definition at line 94 of file BasicString.h.

BasicString<char >& xvr2::BasicString< char >::biteRight ( UInt32  howmany = 1  )  [inline, inherited]

Erases an amount of characters starting from right to left.

Parameters:
howmany The amount of chars to be deleted from the the last portions of the string backwards.
Returns:
A reference to string after modified.

Definition at line 111 of file BasicString.h.

BasicString<char >& xvr2::BasicString< char >::deleteFirst (  )  [inline, inherited]

Erases the first character from the string itself.

Returns:
A reference to string after modified.

Definition at line 125 of file BasicString.h.

References xvr2::BasicString< _charT >::biteLeft().

Here is the call graph for this function:

BasicString<char >& xvr2::BasicString< char >::deleteLast (  )  [inline, inherited]

Erases the last character from the string itself.

Returns:
A reference to string after modified.

Definition at line 130 of file BasicString.h.

References xvr2::BasicString< _charT >::biteRight().

Here is the call graph for this function:

virtual BasicString<char >& xvr2::BasicString< char >::trim ( const char   c = ' '  )  [inline, virtual, inherited]

Combines BasicString::trimLeft and BasicString::trimRight.

Parameters:
c The character to look for and erase.
Returns:
A reference to string after modified.

Definition at line 165 of file BasicString.h.

References xvr2::BasicString< _charT >::trimLeft(), and xvr2::BasicString< _charT >::trimRight().

Here is the call graph for this function:

virtual bool xvr2::BasicString< char >::equals ( const char *  s  )  [inline, virtual, inherited]

Verifies if the string is EXACTLY the same as the given argument.

Parameters:
s The string to be compared with.
Returns:
true if both are the same, false if not.

Definition at line 174 of file BasicString.h.

virtual bool xvr2::BasicString< char >::equals ( const BasicString< char > &  s  )  [inline, virtual, inherited]

Verifies if the string is EXACTLY the same as the given argument.

Parameters:
s The string to be compared with.
Returns:
true if both are the same, false if not.

Definition at line 181 of file BasicString.h.

virtual bool xvr2::BasicString< char >::equals ( const BasicString< char > &  s  )  const [inline, virtual, inherited]

Verifies if the string is EXACTLY the same as the given argument.

Parameters:
s The string to be compared with.
Returns:
true if both are the same, false if not.

Definition at line 188 of file BasicString.h.

virtual bool xvr2::BasicString< char >::operator== ( const char *  s  )  [inline, virtual, inherited]

Verifies if the string is EXACTLY the same as the given argument.

Parameters:
s The string to be compared with.
Returns:
true if both are the same, false if not.

Definition at line 195 of file BasicString.h.

virtual bool xvr2::BasicString< char >::operator== ( const BasicString< char > &  s  )  [inline, virtual, inherited]

Verifies if the string is EXACTLY the same as the given argument.

Parameters:
s The string to be compared with.
Returns:
true if both are the same, false if not.

Definition at line 202 of file BasicString.h.

void xvr2::BasicString< char >::deleteString (  )  [inline, inherited]

Deletes the string contents.

Definition at line 206 of file BasicString.h.

const char * xvr2::BasicString< char >::toCharPtr (  )  const [inline, inherited]

Converts the string to an array of characters.

Returns:
A const pointer to the internal character array.

Definition at line 211 of file BasicString.h.

const char * xvr2::BasicString< char >::toCharPtr (  )  [inline, inherited]

Converts the string to an array of characters.

Returns:
A const pointer to the internal character array.

Definition at line 216 of file BasicString.h.

const char xvr2::BasicString< char >::charAt ( int  i  )  const [inline, inherited]

Gets the character located at the given position.

Parameters:
i The position where the requested character is located at.
Returns:
the character at given position i.

Definition at line 223 of file BasicString.h.

const char xvr2::BasicString< char >::charAt ( int  i  )  [inline, inherited]

Gets the character located at the given position.

Parameters:
i The position where the requested character is located at.
Returns:
the character at given position i.

Definition at line 230 of file BasicString.h.

const char xvr2::BasicString< char >::operator[] ( int  i  )  [inline, inherited]

Gets the character located at the given position.

Parameters:
i The position where the requested character is located at.
Returns:
the character at given position i.

Definition at line 237 of file BasicString.h.

const char xvr2::BasicString< char >::operator[] ( int  i  )  const [inline, inherited]

Gets the character located at the given position.

Parameters:
i The position where the requested character is located at.
Returns:
the character at given position i.

Definition at line 244 of file BasicString.h.

bool xvr2::BasicString< char >::startsWith ( const char *  s  )  const [inline, inherited]

Tells if the string starts with the given substring.

Parameters:
s substring to look at the beginning.
Returns:
true if the string starts with the specified substring, false otherwise.

Definition at line 251 of file BasicString.h.

bool xvr2::BasicString< char >::endsWith ( const char *  s  )  const [inline, inherited]

Tells if the string ends with the given substring.

Parameters:
s substring to look at the end.
Returns:
true if the string ends with the specified substring, false otherwise.

Definition at line 258 of file BasicString.h.

BasicString<char >& xvr2::BasicString< char >::deleteCharAt ( int  pos  )  [inline, inherited]

Erases a character at the given position.

Parameters:
pos The position (from left to right) where the character we want to delete is located at.
Returns:
A reference to the string after modified.

Definition at line 269 of file BasicString.h.

BasicString<char >& xvr2::BasicString< char >::insertCharAt ( const int  pos,
const char   c 
) [inline, inherited]

Insert a specifig character at the given position.

Parameters:
pos The position at where we want to place the character
c The character we want to insert.
Returns:
A reference to the string after modified.

Definition at line 277 of file BasicString.h.

BasicString<char >& xvr2::BasicString< char >::replace ( const char   from,
const char *  to 
) [inline, inherited]

Replaces all occurrences of a character with the given character array.

Parameters:
from The character we wish to replace.
to The array of characters wish will be used as replacement.
Returns:
A reference to the string after modified.

Definition at line 296 of file BasicString.h.

References xvr2::BasicString< _charT >::charAt().

Here is the call graph for this function:

virtual const char* xvr2::Object::getClassName (  )  [virtual, inherited]

Returns the name of the current class.

static void xvr2::Object::debugmsg ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

Will print a debug message to the screen.

static void xvr2::Object::debugmsgln ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const String s 
) [friend]

Lets you send the contents of a String an std::ostream.

This method allows you to do something like:

  String a = "hello world";
  std::cout << a << std::endl;
Parameters:
stream The std::ostream which is to receive the String contents.
s The String to be sent.
Returns:
A reference to the std::ostream object after modified.

std::ostream& operator<< ( std::ostream &  stream,
const Object s 
) [friend, inherited]


Member Data Documentation

std::string xvr2::Object::__cls_name [protected, inherited]

Definition at line 30 of file Object.h.


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

Generated on Fri Jun 20 22:55:57 2008 for X-VR2 SDK by  doxygen 1.5.5