rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlString Class Reference

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

#include <ilog/string.h>

List of all members.

Public Member Functions

 IlString (double value, const char *format=DefaultDoubleFormat)
 This constructor is the conversion constructor from a double.
 IlString (float value, const char *format=DefaultFloatFormat)
 This constructor is the conversion constructor from a float.
 IlString (unsigned long value, const char *format=DefaultUnsignedLongFormat)
 This constructor is the conversion constructor from an unsigned long integer.
 IlString (long value, const char *format=DefaultLongFormat)
 This constructor is the conversion constructor from a long integer.
 IlString (unsigned short value, const char *format=DefaultUnsignedShortFormat)
 This constructor is the conversion constructor from an unsigned short integer.
 IlString (short value, const char *format=DefaultShortFormat)
 This constructor is the conversion constructor from a short integer.
 IlString (unsigned int value, const char *format=DefaultUnsignedIntegerFormat)
 This constructor is the conversion constructor from an unsigned integer.
 IlString (int value, const char *format=DefaultIntegerFormat)
 This constructor is the conversion constructor from an integer.
 IlString (const IlString &string)
 This constructor is the copy constructor.
 IlString (const char *cstring=0)
 This constructor builds an IlString object from the C string cstring.
 ~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.
IlStringcatenate (const IlString &string, int start=0, int end=-1)
 This member function catenates the given string to this.
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.
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.
IlBoolean endsWith (const IlString &, int=0, int=-1) const
 This member function returns IlTrue when the strings ends with string, IlFalse otherwise.
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.
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.
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.
size_t getLength () const
 This member function returns the length of the string.
size_t getSize () const
 This member function returns the size of the string.
IlString getSubString (int start=0, int end=-1) const
 This member function returns a new IlString, substring of the current string.
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.
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.
IlBoolean isBlank () const
 This member function returns IlTrue when the string is empty or contains only spaces, tabs, and so on; IlFalse otherwise.
IlBoolean isEmpty () const
 This member function returns IlTrue when the string is empty, IlFalse otherwise.
 operator const char * () const
 Conversion operator to C-style string.
IlBoolean operator! () const
 The not operator.
IlBoolean operator!= (const IlString &string) const
 Inequality operator.
IlStringoperator+= (const IlString &string)
 Merge operator.
IlBoolean operator< (const IlString &string) const
 Less operator.
IlBoolean operator<= (const IlString &string) const
 Less-or-equal operator.
IlStringoperator= (const IlString &string)
 Assignment operator.
IlBoolean operator== (const IlString &string) const
 Equality operator.
IlBoolean operator> (const IlString &string) const
 Greater operator.
IlBoolean operator>= (const IlString &string) const
 Greater-or-equal operator.
IlStringprepend (const IlString &string, int start=0, int end=-1)
 This member function prepends the given string to this.
void readQuoted (istream &istr)
 This member function reads from the stream istr and fills in this.
IlStringremove (const IlString &subString, int start=0, int end=-1)
 This member function removes a substring of the current string.
IlStringremove (int start=0, int end=-1)
 This member function removes a part of the current string.
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.
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.
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.
IlStringtoLower ()
 This member function converts the current string to lower case.
IlStringtoUpper ()
 This member function converts the current string to upper case.
void writeQuoted (ostream &ostr) const
 This member function writes the string into the stream ostr surrounded by double quotes.

Friends

istream & operator>> (istream &, IlString &)
 Input operator.

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  ) 

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

A copy of cstring is used internally. Giving a null value is equivalent to giving "".

This constructor is also the default constructor.

Parameters:
cstring A constant pointer to a C-style string.
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:
string A constant reference to an IlString object.
See also:
IlString::IlString(const char*)
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 ( 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:
value An int.
format A pointer to a C-style string. The default value is "\%d".
See also:
IlString::IlString(const char*)
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*)
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:
value An unsigned int.
format A pointer to a C-style string. The default value is "\%u".
See also:
IlString::IlString(const char*)
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*)
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:
value A short int.
format A pointer to a C-style string. The default value is "\%hd".
See also:
IlString::IlString(const char*)
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*)
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:
value An unsigned short.
format A pointer to a C-style string. The default value is "\%hu".
See also:
IlString::IlString(const char*)
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*)
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:
value A long integer.
format A pointer to a C-style string. The default value is "\%ld".
See also:
IlString::IlString(const char*)
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*)
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:
value An unsigned long.
format A pointer to a C-style string. The default value is "\%lu".
See also:
IlString::IlString(const char*)
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*)
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:
value A float.
format A pointer to a C-style string. The default value is "\%f".
See also:
IlString::IlString(const char*)
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*)
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:
value A double.
format A pointer to a C-style string. The default value is "\%g".
See also:
IlString::IlString(const char*)
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:
string A constant reference to an IlString object.
start1 An int. The default value is 0.
end1 An int. The default value is -1.
start2 An int. The default value is 0.
end2 An 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:
string A constant reference to an IlString object.
start An int. The default value is 0.
end An 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:
string A constant reference to an IlString object.
start1 An int. The default value is 0.
end1 An int. The default value is -1.
start2 An int. The default value is 0.
end2 An 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:
subString A constant reference to an IlString object.
subStart An int. The default value is 0.
subEnd An 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:
string A constant reference to an IlString object.
start1 An int. The default value is 0.
end1 An int. The default value is -1.
start2 An int. The default value is 0.
end2 An 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:
subString A constant reference to an IlString object.
start An int. The default value is 0.
subStart An int. The default value is 0.
subEnd An 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:
subString A constant reference to an IlString object.
end An int. The default value is -1.
subStart An int. The default value is 0.
subEnd An 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:
start An int. The default value is 0.
end An 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:
string A constant reference to an IlString object.
position An int. The default value is 0.
start An int. The default value is 0.
end An 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:
string A 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:
string A 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:
string A 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:
string A 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:
string A 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:
string A 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:
string A 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:
string A 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:
string A constant reference to an IlString object.
start An int. The default value is 0.
end An 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 ( 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:
istr A reference to an istream.
See also:
IlString::writeQuoted
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:
subString A constant reference to an IlString object.
start An int. The default value is 0.
end An int. The default value is -1.
Returns:
A reference to the current object.
See also:
IlString::remove
IlString::replace
IlString::substitute
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:
string A constant reference to an IlString object.
start An int. The default value is 0.
end An 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:
string A constant reference to an IlString object.
start An int. The default value is 0.
end An int. The default value is -1.
subStart An int. The default value is 0.
subEnd An 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:
string A constant reference to an IlString object.
start An int. The default value is 0.
end An 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:
string1 A constant reference to an IlString object.
string2 A constant reference to an IlString object.
start An int. The default value is 0.
end An int. The default value is -1.
subStart1 An int. The default value is 0.
subEnd1 An int. The default value is -1.
subStart2 An int. The default value is 0.
subEnd2 An 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 ( 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:
ostr A reference to an ostream.
See also:
IlString::readQuoted

Friends And Related Function Documentation

istream& operator>> ( istream &  ,
IlString  
) [friend]

Input operator.

This operator reads from the output stream istr a representation of the string string.

Parameters:
istr A reference to an istream.
string A reference to an IlString.
Returns:
A reference to the given input stream.
See also:
IlString::readQuoted
operator<<(IL_STDPREF ostream&, const IlString&) const
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, 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.