rwlogo

Rogue Wave DBLink API Reference Guide

Product Documentation:

Rogue Wave DBLink
Documentation Home

List of all members | Public Member Functions
IlString Class Reference

Class that manages strings in single or multibytes. More...

#include <ilog/string.h>

Public Member Functions

 IlString (const char *cstring=0, int length=-1)
 This constructor builds an IlString object from the C string cstring. More...
 
 IlString (const IlString &string)
 This constructor is the copy constructor. More...
 
IL_EXPLICIT IlString (int value, const char *format=DefaultIntegerFormat)
 This constructor is the conversion constructor from an integer. More...
 
IL_EXPLICIT IlString (unsigned int value, const char *format=DefaultUnsignedIntegerFormat)
 This constructor is the conversion constructor from an unsigned integer. More...
 
IL_EXPLICIT IlString (short value, const char *format=DefaultShortFormat)
 This constructor is the conversion constructor from a short integer. More...
 
IL_EXPLICIT IlString (unsigned short value, const char *format=DefaultUnsignedShortFormat)
 This constructor is the conversion constructor from an unsigned short integer. More...
 
IL_EXPLICIT IlString (long value, const char *format=DefaultLongFormat)
 This constructor is the conversion constructor from a long integer. More...
 
IL_EXPLICIT IlString (unsigned long value, const char *format=DefaultUnsignedLongFormat)
 This constructor is the conversion constructor from an unsigned long integer. More...
 
IL_EXPLICIT IlString (float value, const char *format=DefaultFloatFormat)
 This constructor is the conversion constructor from a float. More...
 
IL_EXPLICIT IlString (double value, const char *format=DefaultDoubleFormat)
 This constructor is the conversion constructor from a double. More...
 
 ~IlString ()
 The destructor releases the resources used by the object.
 
int caseCompare (const IlString &string, int start1=0, int end1=-1, int start2=0, int end2=-1) const
 This member function returns an int according to the lexicographical order (case insensitive) of this in relation to string. More...
 
IlStringcatenate (const IlString &string, int start=0, int end=-1)
 This member function catenates the given string to this. More...
 
int compare (const IlString &string, int start1=0, int end1=-1, int start2=0, int end2=-1) const
 This member function returns an int according to the lexicographical order of this in relation to string. More...
 
char * copyValue () const
 This member function returns a const pointer to a new allocated C-style string in single or multibyte according to the locale of the program. More...
 
IlBoolean endsWith (const IlString &, int=0, int=-1) const
 This member function returns IlTrue when the strings ends with string, IlFalse otherwise. More...
 
IlBoolean equals (const IlString &string, int start1=0, int end1=-1, int start2=0, int end2=-1) const
 This member function returns IlTrue when the strings this and string are equal. More...
 
int getIndexOf (const IlString &subString, int start=0, int subStart=0, int subEnd=-1) const
 This member function returns the index of the first position of the substring subString in the current string. More...
 
int getLastIndexOf (const IlString &subString, int end=-1, int subStart=0, int subEnd=-1) const
 This member function returns the index of the last position of the substring subString in the string. More...
 
size_t getLength () const
 This member function returns the length of the string. More...
 
size_t getSize () const
 This member function returns the size of the string. More...
 
IlString getSubString (int start=0, int end=-1) const
 This member function returns a new IlString, substring of the current string. More...
 
const char * getValue () const
 This member function returns a const pointer to a C-style string in single or multibyte according to the locale of the program. More...
 
IlStringinsert (const IlString &string, int position=0, int start=0, int end=-1)
 This member function inserts the given string to this at the given position. More...
 
IlBoolean isBlank () const
 This member function returns IlTrue when the string is empty or contains only spaces, tabs, and so on; IlFalse otherwise. More...
 
IlBoolean isEmpty () const
 This member function returns IlTrue when the string is empty, IlFalse otherwise. More...
 
 operator const char * () const
 Conversion operator to C-style string. More...
 
IlBoolean operator! () const
 The not operator. More...
 
IlBoolean operator!= (const IlString &string) const
 Inequality operator. More...
 
IlStringoperator+= (const IlString &string)
 Merge operator. More...
 
IlBoolean operator< (const IlString &string) const
 Less operator. More...
 
IlBoolean operator<= (const IlString &string) const
 Less-or-equal operator. More...
 
IlStringoperator= (const IlString &string)
 Assignment operator. More...
 
IlBoolean operator== (const IlString &string) const
 Equality operator. More...
 
IlBoolean operator> (const IlString &string) const
 Greater operator. More...
 
IlBoolean operator>= (const IlString &string) const
 Greater-or-equal operator. More...
 
IlStringprepend (const IlString &string, int start=0, int end=-1)
 This member function prepends the given string to this. More...
 
void readQuoted (IL_STDPREF istream &istr)
 This member function reads from the stream istr and fills in this. More...
 
IlStringremove (int start=0, int end=-1)
 This member function removes a part of the current string. More...
 
IlStringremove (const IlString &subString, int start=0, int end=-1)
 This member function removes a substring of the current string. More...
 
IlStringreplace (const IlString &string, int start=0, int end=-1, int subStart=0, int subEnd=-1)
 This member function replaces a part of the current string by another string. More...
 
IlBoolean startsWith (const IlString &string, int start=0, int end=-1) const
 This member function returns IlTrue when the current string starts with string, IlFalse otherwise. More...
 
IlStringsubstitute (const IlString &string1, const IlString &string2, int start=0, int end=-1, int subStart1=0, int subEnd1=-1, int subStart2=0, int subEnd2=-1)
 This member function substitutes in the current string the occurrences of a substring by another one. More...
 
IlStringtoLower ()
 This member function converts the current string to lower case. More...
 
IlStringtoUpper ()
 This member function converts the current string to upper case. More...
 
void writeQuoted (IL_STDPREF ostream &ostr) const
 This member function writes the string into the stream ostr surrounded by double quotes. More...
 

Detailed Description

Class that manages strings in single or multibytes.

Library: ilog

According to the locale, the string is created internally with a single or multibyte representation. This class lets you use it without having to take care of this representation. However, this class is not intended to convert either from a single byte to a multibyte string, or from a multibyte to a single byte string. When an IlString object is created, it is supposed to deal with the same locale for its entire life.

This class uses a mechanism of reference counter in order to share the C strings used internally. This means that the pointers returned by IlString::operator const char*() const and IlString::getValue() must be used with care. They may be invalid after any call to a member function that modifies the object that returned this pointer.

Constructor & Destructor Documentation

IlString::IlString ( const char *  cstring = 0,
int  length = -1 
)

This constructor builds an IlString object from the C string cstring.

A copy of cstring, up to length characters, is maintained internally. Giving a null value is equivalent to giving "".

This constructor is also the default constructor.

Parameters
cstringA constant pointer to a C-style string.
lengthThe number of characters to copy from cstring. If length is -1 or greater than the length of cstring, the whole string is copied, up to the final 0 character. Note that if this object represents a multi-byte string, this value may be different than the number of bytes needed to store the string value.
See Also
IlString::IlString(const IlString&)
IlString::IlString(int, const char*)
IlString::IlString(unsigned int, const char*)
IlString::IlString(short, const char*)
IlString::IlString(unsigned short, const char*)
IlString::IlString(long, const char*)
IlString::IlString(unsigned long, const char*)
IlString::IlString(float, const char*)
IlString::IlString(double, const char*)
IlString::IlString ( const IlString string)

This constructor is the copy constructor.

It builds a new IlString object from the object string. The internal C string is shared by both objects until one of them is modified (use of a reference counter).

Parameters
stringA constant reference to an IlString object.
See Also
IlString::IlString(const char*, int)
IlString::IlString(int, const char*)
IlString::IlString(unsigned int, const char*)
IlString::IlString(short, const char*)
IlString::IlString(unsigned short, const char*)
IlString::IlString(long, const char*)
IlString::IlString(unsigned long, const char*)
IlString::IlString(float, const char*)
IlString::IlString(double, const char*)
IL_EXPLICIT IlString::IlString ( int  value,
const char *  format = DefaultIntegerFormat 
)

This constructor is the conversion constructor from an integer.

The conversion is done according to the format. The syntax is compatible with the syntax of the printf family functions. By default, the format is "\%d".

Warning
[note] This constructor is declared as explicit for compilers that implement this keyword.
Parameters
valueAn int.
formatA pointer to a C-style string. The default value is "\%d".
See Also
IlString::IlString(const char*, int)
IlString::IlString(const IlString&)
IlString::IlString(unsigned int, const char*)
IlString::IlString(short, const char*)
IlString::IlString(unsigned short, const char*)
IlString::IlString(long, const char*)
IlString::IlString(unsigned long, const char*)
IlString::IlString(float, const char*)
IlString::IlString(double, const char*)
IL_EXPLICIT IlString::IlString ( unsigned int  value,
const char *  format = DefaultUnsignedIntegerFormat 
)

This constructor is the conversion constructor from an unsigned integer.

The conversion is done according to the format. The syntax is compatible with the syntax of the printf family functions. By default, the format s "\%u".

Warning
[note] This constructor is declared as explicit for compilers that implement this keyword.
Parameters
valueAn unsigned int.
formatA pointer to a C-style string. The default value is "\%u".
See Also
IlString::IlString(const char*, int)
IlString::IlString(const IlString&)
IlString::IlString(int, const char*)
IlString::IlString(short, const char*)
IlString::IlString(unsigned short, const char*)
IlString::IlString(long, const char*)
IlString::IlString(unsigned long, const char*)
IlString::IlString(float, const char*)
IlString::IlString(double, const char*)
IL_EXPLICIT IlString::IlString ( short  value,
const char *  format = DefaultShortFormat 
)

This constructor is the conversion constructor from a short integer.

The conversion is done according to the format. The syntax is compatible with the syntax of the printf family functions. By default, the format is "\%hd".

Warning
[note] This constructor is declared as explicit for compilers that implement this keyword.
Parameters
valueA short int.
formatA pointer to a C-style string. The default value is "\%hd".
See Also
IlString::IlString(const char*, int)
IlString::IlString(const IlString&)
IlString::IlString(int, const char*)
IlString::IlString(unsigned int, const char*)
IlString::IlString(unsigned short, const char*)
IlString::IlString(long, const char*)
IlString::IlString(unsigned long, const char*)
IlString::IlString(float, const char*)
IlString::IlString(double, const char*)
IL_EXPLICIT IlString::IlString ( unsigned short  value,
const char *  format = DefaultUnsignedShortFormat 
)

This constructor is the conversion constructor from an unsigned short integer.

The conversion is done according to the format. The syntax is compatible with the syntax of the printf family functions. By default, the format is "\%hu".

Warning
[note] This constructor is declared as explicit for compilers that implement this keyword.
Parameters
valueAn unsigned short.
formatA pointer to a C-style string. The default value is "\%hu".
See Also
IlString::IlString(const char*, int)
IlString::IlString(const IlString&)
IlString::IlString(int, const char*)
IlString::IlString(unsigned int, const char*)
IlString::IlString(short, const char*)
IlString::IlString(long, const char*)
IlString::IlString(unsigned long, const char*)
IlString::IlString(float, const char*)
IlString::IlString(double, const char*)
IL_EXPLICIT IlString::IlString ( long  value,
const char *  format = DefaultLongFormat 
)

This constructor is the conversion constructor from a long integer.

The conversion is done according to the format. The syntax is compatible with the syntax of the printf family functions. By default, the format is "\%ld".

Warning
[note] This constructor is declared as explicit for compilers that implement this keyword.
Parameters
valueA long integer.
formatA pointer to a C-style string. The default value is "\%ld".
See Also
IlString::IlString(const char*, int)
IlString::IlString(const IlString&)
IlString::IlString(int, const char*)
IlString::IlString(unsigned int, const char*)
IlString::IlString(short, const char*)
IlString::IlString(unsigned short, const char*)
IlString::IlString(unsigned long, const char*)
IlString::IlString(float, const char*)
IlString::IlString(double, const char*)
IL_EXPLICIT IlString::IlString ( unsigned long  value,
const char *  format = DefaultUnsignedLongFormat 
)

This constructor is the conversion constructor from an unsigned long integer.

The conversion is done according to the format. The syntax is compatible with the syntax of the printf family functions. By default, the format is "\%lu".

Warning
[note] This constructor is declared as explicit for compilers that implement this keyword.
Parameters
valueAn unsigned long.
formatA pointer to a C-style string. The default value is "\%lu".
See Also
IlString::IlString(const char*, int)
IlString::IlString(const IlString&)
IlString::IlString(int, const char*)
IlString::IlString(unsigned int, const char*)
IlString::IlString(short, const char*)
IlString::IlString(unsigned short, const char*)
IlString::IlString(long, const char*)
IlString::IlString(float, const char*)
IlString::IlString(double, const char*)
IL_EXPLICIT IlString::IlString ( float  value,
const char *  format = DefaultFloatFormat 
)

This constructor is the conversion constructor from a float.

The conversion is done according to the format. The syntax is compatible with the syntax of the printf family functions. By default, the format is "\%f".

Warning
[note] This constructor is declared as explicit for compilers that implement this keyword.
Parameters
valueA float.
formatA pointer to a C-style string. The default value is "\%f".
See Also
IlString::IlString(const char*, int)
IlString::IlString(const IlString&)
IlString::IlString(int, const char*)
IlString::IlString(unsigned int, const char*)
IlString::IlString(short, const char*)
IlString::IlString(unsigned short, const char*)
IlString::IlString(long, const char*)
IlString::IlString(unsigned long, const char*)
IlString::IlString(double, const char*)
IL_EXPLICIT IlString::IlString ( double  value,
const char *  format = DefaultDoubleFormat 
)

This constructor is the conversion constructor from a double.

The conversion is done according to the format. The syntax is compatible with the syntax of the printf family functions. By default, the format is "\%g".

Warning
[note] This constructor is declared as explicit for compilers that implement this keyword.
Parameters
valueA double.
formatA pointer to a C-style string. The default value is "\%g".
See Also
IlString::IlString(const char*, int)
IlString::IlString(const IlString&)
IlString::IlString(int, const char*)
IlString::IlString(unsigned int, const char*)
IlString::IlString(short, const char*)
IlString::IlString(unsigned short, const char*)
IlString::IlString(long, const char*)
IlString::IlString(unsigned long, const char*)
IlString::IlString(float, const char*)

Member Function Documentation

int IlString::caseCompare ( const IlString string,
int  start1 = 0,
int  end1 = -1,
int  start2 = 0,
int  end2 = -1 
) const

This member function returns an int according to the lexicographical order (case insensitive) of this in relation to string.

The return value is negative when this is before string.
It is null when the strings are equal.
It is positive when this is after string.

The order depends on the locale. The comparison is done on the strings in lower case.

The string this may be restricted by start1 and end1.

The string string may be restricted by start2 and end2.

Parameters
stringA constant reference to an IlString object.
start1An int. The default value is 0.
end1An int. The default value is -1.
start2An int. The default value is 0.
end2An int. The default value is -1.
Returns
An IlBoolean.
See Also
IlString::compare
IlString& IlString::catenate ( const IlString string,
int  start = 0,
int  end = -1 
)

This member function catenates the given string to this.

The string string may be restricted by start and end. If end is equal to -1 this means the end of the substring. Otherwise it is the index of the first char in the string after the substring.
It returns *this.

Warning: This function may modify the internal representation of the string. This means that any pointer that was returned by IlString::getValue or IlString::operator const char*() may be invalid.

Parameters
stringA constant reference to an IlString object.
startAn int. The default value is 0.
endAn int. The default value is -1.
Returns
A reference to the current object.
See Also
IlString::prepend
IlString::insert
IlString::operator+=(const IlString&)
operator+(const IlString&, const IlString&)
operator<<(IlString&, const IlString&)
operator<<(IlString&, const char*)
int IlString::compare ( const IlString string,
int  start1 = 0,
int  end1 = -1,
int  start2 = 0,
int  end2 = -1 
) const

This member function returns an int according to the lexicographical order of this in relation to string.

The return value is negative when this is before string.
It is null when the strings are equal.
It is positive when this is after string.

The order depends on the locale.

The string this may be restricted by start1 and end1.

The string string may be restricted by start2 and end2.

If end1 or end2 are equal to -1, that means the relative string is taken until its end. Otherwise this parameter is the index of the first character that follows the relative substring.

Parameters
stringA constant reference to an IlString object.
start1An int. The default value is 0.
end1An int. The default value is -1.
start2An int. The default value is 0.
end2An int. The default value is -1.
Returns
An IlBoolean.
See Also
IlString::caseCompare
IlString::equals
char* IlString::copyValue ( ) const

This member function returns a const pointer to a new allocated C-style string in single or multibyte according to the locale of the program.

The pointed C string must be deleted with the operator delete[] by the caller when it is no longer used.

Returns
A pointer to a C-style string allocated with the new[] operator.
See Also
IlString::getValue
IlString::operator const char*() const
IlBoolean IlString::endsWith ( const IlString ,
int  = 0,
int  = -1 
) const

This member function returns IlTrue when the strings ends with string, IlFalse otherwise.

The string may be restricted by start and end. If end is equal to -1 that means the end of the substring. Otherwise it is the index of the first char in the string after the substring.

Parameters
subStringA constant reference to an IlString object.
subStartAn int. The default value is 0.
subEndAn int. The default value is -1.
Returns
An IlBoolean.
See Also
IlString::startsWith
IlString::getLastIndexOf
IlBoolean IlString::equals ( const IlString string,
int  start1 = 0,
int  end1 = -1,
int  start2 = 0,
int  end2 = -1 
) const

This member function returns IlTrue when the strings this and string are equal.

The strings are equal when strcmp (or the equivalent for multibyte) returns 0.

The string this may be restricted by start1 and end1.

The string string may be restricted by start2 and end2. If end1 or end2 are equal to -1, that means the relative string is taken until its end. Otherwise this parameter is the index of the first character that follows the relative substring.

Parameters
stringA constant reference to an IlString object.
start1An int. The default value is 0.
end1An int. The default value is -1.
start2An int. The default value is 0.
end2An int. The default value is -1.
Returns
An IlBoolean.
See Also
IlString::compare
int IlString::getIndexOf ( const IlString subString,
int  start = 0,
int  subStart = 0,
int  subEnd = -1 
) const

This member function returns the index of the first position of the substring subString in the current string.

The search starts at the position start. The substring may be restricted by the parameters subStart and subEnd. If subEnd is equal to -1 that means the end of the substring. Otherwise it is the index of the first char in the string after the substring.

If the substring is not found, it returns -1.

Parameters
subStringA constant reference to an IlString object.
startAn int. The default value is 0.
subStartAn int. The default value is 0.
subEndAn int. The default value is -1.
Returns
An int.
See Also
IlString::getSubString
IlString::getLastIndexOf
int IlString::getLastIndexOf ( const IlString subString,
int  end = -1,
int  subStart = 0,
int  subEnd = -1 
) const

This member function returns the index of the last position of the substring subString in the string.

The search starts at the position end, a value of -1 means the end of the string. The substring may be restricted by the parameters subStart and subEnd. If subEnd is equal to -1 that means the end of the substring. Otherwise it is the index of the first char in the string after the substring.

If the substring is not found, it returns -1.

Parameters
subStringA constant reference to an IlString object.
endAn int. The default value is -1.
subStartAn int. The default value is 0.
subEndAn int. The default value is -1.
Returns
An int.
See Also
IlString::getSubString
IlString::getIndexOf
size_t IlString::getLength ( ) const

This member function returns the length of the string.

It is the number of characters of the string.

Returns
A size_t.
See Also
IlString::getSize
size_t IlString::getSize ( ) const

This member function returns the size of the string.

It is the size needed to represent the string (with the final 0). It is not necessarily the number of characters of this string.

Returns
A size_t.
See Also
IlString::getLength
IlString IlString::getSubString ( int  start = 0,
int  end = -1 
) const

This member function returns a new IlString, substring of the current string.

The substring is defined by start and end.

The value of start is the index of the position where the substring starts.

The value of end is the (position+1) of the last character of the substring. This means that the character whose position is end, if it exists, is not included.

For end == -1, this member function returns the tail of the string from start.

Parameters
startAn int. The default value is 0.
endAn int. The default value is -1.
Returns
An IlString object.
See Also
IlString::getIndexOf
IlString::getLastIndexOf
const char* IlString::getValue ( ) const

This member function returns a const pointer to a C-style string in single or multibyte according to the locale of the program.

The pointed C string is the internal one. It must never be modified nor deleted.

Returns
A const pointer to a C-style string.
See Also
IlString::copyValue
IlString::operator const char*() const
IlString& IlString::insert ( const IlString string,
int  position = 0,
int  start = 0,
int  end = -1 
)

This member function inserts the given string to this at the given position.

The string string may be restricted by start and end. If end is equal to -1 that means the end of the substring. Otherwise it is the index of the first char in the string after the substring.
It returns *this.

Warning: This function may modify the internal representation of the string. This means that any pointer that was returned by IlString::getValue or IlString::operator const char*() may be invalid.

Parameters
stringA constant reference to an IlString object.
positionAn int. The default value is 0.
startAn int. The default value is 0.
endAn int. The default value is -1.
Returns
A reference to the current object.
See Also
IlString::catenate
IlString::prepend
IlString::operator+=(const IlString&)
operator+(const IlString&, const IlString&)
operator<<(IlString&, const IlString&)
operator<<(IlString&, const char*)
IlBoolean IlString::isBlank ( ) const

This member function returns IlTrue when the string is empty or contains only spaces, tabs, and so on; IlFalse otherwise.

Returns
An IlBoolean.
See Also
IlString::isEmpty() const
IlBoolean IlString::isEmpty ( ) const

This member function returns IlTrue when the string is empty, IlFalse otherwise.

Returns
An IlBoolean.
See Also
IlString::operator!() const
IlString::isBlank() const
IlString::operator const char * ( ) const

Conversion operator to C-style string.

This conversion operator returns a const pointer to a C-style string in single or multibyte according to the locale of the program.

The pointed C string is the internal one. It must never be modified nor deleted.

Returns
A const pointer to a C-style string.
See Also
IlString::getValue
IlString::copyValue
IlBoolean IlString::operator! ( ) const

The not operator.

This operator returns IlTrue when the string is empty, IlFalse otherwise.

Returns
An IlBoolean.
See Also
IlString::isEmpty
IlBoolean IlString::operator!= ( const IlString string) const

Inequality operator.

This operator returns IlFalse when the strings are equal, that is, when the function strcmp (or the equivalent for multibyte) returns 0, and IlTrue otherwise.

Parameters
stringA constant reference to an IlString object.
Returns
An IlBoolean.
See Also
IlString::operator==(const IlString&) const
IlString::equals
IlString& IlString::operator+= ( const IlString string)

Merge operator.

This operator catenates the given string to this. It returns *this.

Warning: This operator may modify the internal representation of the string. This means that any pointer that was returned by IlString::getValue or IlString::operator const char*() may be invalid.

Parameters
stringA constant reference to an IlString object.
Returns
A reference to the current object.
See Also
IlString::operator=(const IlString&)
operator+(const IlString&, const IlString&)
operator<<(IlString&, const IlString&)
operator<<(IlString&, const char*)
IlBoolean IlString::operator< ( const IlString string) const

Less operator.

This operator returns IlTrue when the string is strictly before string in the lexicographical order, IlFalse otherwise.

Parameters
stringA constant reference to an IlString object.
Returns
An IlBoolean.
See Also
IlString::operator<=(const IlString&) const
IlString::operator>(const IlString&) const
IlString::operator>=(const IlString&) const
IlString::compare
IlBoolean IlString::operator<= ( const IlString string) const

Less-or-equal operator.

This operator returns IlTrue when the string is before string in the lexicographical order or equal to string, IlFalse otherwise.

Parameters
stringA constant reference to an IlString object.
Returns
An IlBoolean.
See Also
IlString::operator<(const IlString&) const
IlString::operator>(const IlString&) const
IlString::operator>=(const IlString&) const
IlString::compare
IlString& IlString::operator= ( const IlString string)

Assignment operator.

This operator assigns the given string to this. It returns *this.

Warning: This operator may modify the internal representation of the string. This means that any pointer that was returned by IlString::getValue or IlString::operator const char*() may be invalid.

Parameters
stringA constant reference to an IlString object.
Returns
A reference to the current object.
See Also
operator+=(const IlString&)
operator<<(IlString&, const IlString&)
operator<<(IlString&, const char*)
IlBoolean IlString::operator== ( const IlString string) const

Equality operator.

This operator returns IlTrue when the strings are equal, that is, when the function strcmp (or equivalent for multibyte) returns 0, and IlFalse otherwise.

Parameters
stringA constant reference to an IlString object.
Returns
An IlBoolean.
See Also
IlString::operator!=(const IlString&) const
IlString::equals
IlBoolean IlString::operator> ( const IlString string) const

Greater operator.

This operator returns IlTrue when the string is strictly after string in the lexicographical order, IlFalse otherwise.

Parameters
stringA constant reference to an IlString object.
Returns
An IlBoolean.
See Also
IlString::operator<(const IlString&) const
IlString::operator<=(const IlString&) const
IlString::operator>=(const IlString&) const
IlString::compare
IlBoolean IlString::operator>= ( const IlString string) const

Greater-or-equal operator.

This operator returns IlTrue when the string is after string in the lexicographical order or equal to string, IlFalse otherwise.

Parameters
stringA constant reference to an IlString object.
Returns
An IlBoolean.
See Also
IlString::operator<(const IlString&) const
IlString::operator<=(const IlString&) const
IlString::operator>(const IlString&) const
IlString::compare
IlString& IlString::prepend ( const IlString string,
int  start = 0,
int  end = -1 
)

This member function prepends the given string to this.

The string string may be restricted by start and end. If end is equal to -1 that means the end of the substring. Otherwise it is the index of the first char in the string after the substring.
It returns *this.

Warning: This function may modify the internal representation of the string. This means that any pointer that was returned by IlString::getValue or IlString::operator const char*() may be invalid.

Parameters
stringA constant reference to an IlString object.
startAn int. The default value is 0.
endAn int. The default value is -1.
Returns
A reference to the current object.
See Also
IlString::catenate
IlString::insert
IlString::operator+=(const IlString&)
operator+(const IlString&, const IlString&)
operator<<(IlString&, const IlString&)
operator<<(IlString&, const char*)
void IlString::readQuoted ( IL_STDPREF istream &  istr)

This member function reads from the stream istr and fills in this.

The format is defined in the function IlString::writeQuoted(IL_STDPREF ostream&) const.

Warning: This function may modify the internal representation of the string. This means that any pointer that was returned by IlString::getValue or IlString::operator const char*() may be invalid.

Parameters
istrA reference to an istream.
See Also
IlString::writeQuoted
IlString& IlString::remove ( int  start = 0,
int  end = -1 
)

This member function removes a part of the current string.

The part to be removed is defined by its start position and its end position (not included). If end is equal to -1, the end of the string is removed.
This member function returns *this.

Warning: This function may modify the internal representation of the string. This means that any pointer that was returned by IlString::getValue or IlString::operator const char*() may be invalid.

Parameters
stringA constant reference to an IlString object.
startAn int. The default value is 0.
endAn int. The default value is -1.
Returns
A reference to the current object.
See Also
IlString::remove
IlString::replace
IlString::substitute
IlString& IlString::remove ( const IlString subString,
int  start = 0,
int  end = -1 
)

This member function removes a substring of the current string.

The part to be removed is defined by subString, possibly restricted by start and end. If end is equal to -1 that means the end of the substring. Otherwise it is the index of the first char in the string after the substring. If the substring subString is not part of the string, this latter is not modified.
This member function returns *this.

Warning: This function may modify the internal representation of the string. This means that any pointer that was returned by IlString::getValue or IlString::operator const char*() may be invalid.

Parameters
subStringA constant reference to an IlString object.
startAn int. The default value is 0.
endAn int. The default value is -1.
Returns
A reference to the current object.
See Also
IlString::remove
IlString::replace
IlString::substitute
IlString& IlString::replace ( const IlString string,
int  start = 0,
int  end = -1,
int  subStart = 0,
int  subEnd = -1 
)

This member function replaces a part of the current string by another string.

The substring to be removed is defined by start and end. If end is equal to -1 that means the end of the substring. Otherwise it is the index of the first char in the string after the substring.
Ths substring string may be restricted by subStart and subEnd. If subEnd is equal to -1 that means the end of the substring. Otherwise it is the index of the first char in the string after the substring.

This member function returns *this.

Warning: This function may modify the internal representation of the string. This means that any pointer that was returned by IlString::getValue or IlString::operator const char*() may be invalid.

Parameters
stringA constant reference to an IlString object.
startAn int. The default value is 0.
endAn int. The default value is -1.
subStartAn int. The default value is 0.
subEndAn int. The default value is -1.
Returns
A reference to the current object.
See Also
IlString::remove
IlString::remove
IlString::substitute
IlBoolean IlString::startsWith ( const IlString string,
int  start = 0,
int  end = -1 
) const

This member function returns IlTrue when the current string starts with string, IlFalse otherwise.

The string may be restricted by start and end. If end is equal to -1 that means the end of the substring. Otherwise it is the index of the first char in the string after the substring.

Parameters
stringA constant reference to an IlString object.
startAn int. The default value is 0.
endAn int. The default value is -1.
Returns
An IlBoolean.
See Also
IlString::endsWith
IlString::getIndexOf
IlString& IlString::substitute ( const IlString string1,
const IlString string2,
int  start = 0,
int  end = -1,
int  subStart1 = 0,
int  subEnd1 = -1,
int  subStart2 = 0,
int  subEnd2 = -1 
)

This member function substitutes in the current string the occurrences of a substring by another one.

The substring to be replaced is defined by string1, possibly restricted by subStart1 and subEnd1. If subEnd1 is equal to -1 that means the end of the substring. Otherwise it is the index of the first char in the string after the substring. The new substring is defined by string2, possibly restricted by subStart2 and subEnd2. If subEnd2 is equal to -1 that means the end of the substring. Otherwise it is the index of the first char in the string after the substring. The substitution may be limited to the part of the string defined by start and end. If end is equal to -1 that means the end of the substring. Otherwise it is the index of the first char in the string after the substring.

This member function returns *this.

Warning: This function may modify the internal representation of the string. This means that any pointer that was returned by IlString::getValue or IlString::operator const char*() may be invalid.

Parameters
string1A constant reference to an IlString object.
string2A constant reference to an IlString object.
startAn int. The default value is 0.
endAn int. The default value is -1.
subStart1An int. The default value is 0.
subEnd1An int. The default value is -1.
subStart2An int. The default value is 0.
subEnd2An int. The default value is -1.
Returns
A reference to the current object.
See Also
IlString::remove
IlString::remove
IlString::replace
IlString& IlString::toLower ( )

This member function converts the current string to lower case.

This member function returns *this.

Warning: This function may modify the internal representation of the string. This means that any pointer that was returned by IlString::getValue or IlString::operator const char*() may be invalid.

Returns
A reference to the current object.
See Also
IlString::toUpper
IlString& IlString::toUpper ( )

This member function converts the current string to upper case.

This member function returns *this.

Warning: This function may modify the internal representation of the string. This means that any pointer that was returned by IlString::getValue or IlString::operator const char*() may be invalid.

Returns
A reference to the current object.
See Also
IlString::toLower
void IlString::writeQuoted ( IL_STDPREF ostream &  ostr) const

This member function writes the string into the stream ostr surrounded by double quotes.

Every space and double quote is prefixed by a backslash.

Parameters
ostrA reference to an ostream.
See Also
IlString::readQuoted

© Copyright 2014, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.