rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWWString Class Reference
[String Processing]

Offers powerful and convenient facilities for manipulating wide character strings. More...

#include <rw/wstring.h>

Inheritance diagram for RWWString:
RWCollectableWString

List of all members.

Public Types

enum  stripType { leading, trailing, both }
enum  caseCompare { exact, ignoreCase, ignoreCaseStrict }
enum  ascii_ { ascii }
enum  multiByte_ { multiByte }
typedef RWWSubString SubString
typedef RWWConstSubString ConstSubString

Public Member Functions

 RWWString ()
 RWWString (const std::wstring &str)
 RWWString (const RWWString &str)
 RWWString (RWWString &&str)
 RWWString (RWSize_T cap)
 RWWString (wchar_t c)
 RWWString (wchar_t c, size_t count)
 RWWString (const wchar_t *str)
 RWWString (const wchar_t *str, size_t len)
 RWWString (char c)
 RWWString (char c, size_t count)
 RWWString (signed char c)
 RWWString (unsigned char c)
 RWWString (const char *str, ascii_)
 RWWString (const RWCString &str, ascii_)
 RWWString (const char *str, multiByte_)
 RWWString (const RWCString &str, multiByte_)
 RWWString (const char *str, size_t len, ascii_)
 RWWString (const char *str, size_t len, multiByte_)
 RWWString (const SubString &str)
 RWWString (const ConstSubString &str)
 operator const wchar_t * () const
RWWStringoperator= (wchar_t c)
RWWStringoperator= (const wchar_t *str)
RWWStringoperator= (const std::wstring &str)
RWWStringoperator= (const RWWString &str)
RWWStringoperator= (RWWString &&str)
RWWStringoperator+= (wchar_t c)
RWWStringoperator+= (const wchar_t *str)
RWWStringoperator+= (const std::wstring &str)
RWWStringoperator+= (const RWWString &str)
wchar_t & operator() (size_t i)
wchar_t operator() (size_t i) const
wchar_t & operator[] (short i)
wchar_t & operator[] (int i)
wchar_t & operator[] (long i)
wchar_t & operator[] (unsigned short i)
wchar_t & operator[] (unsigned int i)
wchar_t & operator[] (unsigned long i)
wchar_t operator[] (short i) const
wchar_t operator[] (int i) const
wchar_t operator[] (long i) const
wchar_t operator[] (unsigned short i) const
wchar_t operator[] (unsigned int i) const
wchar_t operator[] (unsigned long i) const
wchar_t & operator[] (long long i)
wchar_t & operator[] (unsigned long long i)
wchar_t operator[] (long long i) const
wchar_t operator[] (unsigned long long i) const
SubString operator() (size_t start, size_t len)
ConstSubString operator() (size_t start, size_t len) const
SubString subString (const wchar_t *pat, size_t start=0, caseCompare cmp=exact)
ConstSubString subString (const wchar_t *pat, size_t start=0, caseCompare cmp=exact) const
SubString strip (stripType st=trailing, wchar_t c=L' ')
ConstSubString strip (stripType st=trailing, wchar_t c=L' ') const
RWWStringappend (wchar_t c, size_t count=1)
RWWStringappend (const wchar_t *str)
RWWStringappend (const wchar_t *str, size_t len)
RWWStringappend (const std::wstring &str)
RWWStringappend (const RWWString &str)
RWWStringappend (const std::wstring &str, size_t len)
RWWStringappend (const RWWString &str, size_t len)
RWspace binaryStoreSize () const
size_t capacity () const
size_t capacity (size_t cap)
int collate (const wchar_t *str) const
int collate (const std::wstring &str) const
int collate (const RWWString &str) const
int compareTo (const wchar_t *str, caseCompare cmp=exact) const
int compareTo (const std::wstring &str, caseCompare cmp=exact) const
int compareTo (const std::wstring *str, caseCompare cmp=exact) const
int compareTo (const RWWString &str, caseCompare cmp=exact) const
int compareTo (const RWWString *str, caseCompare cmp=exact) const
bool contains (const wchar_t *str, caseCompare cmp=exact) const
bool contains (const std::wstring &str, caseCompare cmp=exact) const
bool contains (const RWWString &str, caseCompare cmp=exact) const
const wchar_t * data () const
std::wstring & std ()
const std::wstring & std () const
void swap (RWWString &str)
size_t first (wchar_t c) const
size_t first (wchar_t c, size_t) const
size_t first (const wchar_t *str) const
size_t first (const wchar_t *str, size_t len) const
unsigned long hash (caseCompare cmp=exact) const
size_t index (const wchar_t *pat, size_t start=0, caseCompare cmp=exact) const
size_t index (const std::wstring &pat, size_t start=0, caseCompare cmp=exact) const
size_t index (const RWWString &pat, size_t start=0, caseCompare cmp=exact) const
size_t index (const wchar_t *pat, size_t patlen, size_t start, caseCompare cmp) const
size_t index (const std::wstring &pat, size_t patlen, size_t start, caseCompare cmp) const
size_t index (const RWWString &pat, size_t patlen, size_t start, caseCompare cmp) const
RWWStringinsert (size_t pos, wchar_t c, size_t count)
RWWStringinsert (size_t pos, const wchar_t *str)
RWWStringinsert (size_t pos, const wchar_t *str, size_t len)
RWWStringinsert (size_t pos, const std::wstring &str)
RWWStringinsert (size_t pos, const RWWString &str)
RWWStringinsert (size_t pos, const std::wstring &str, size_t len)
RWWStringinsert (size_t pos, const RWWString &str, size_t len)
bool isAscii () const
bool isNull () const
size_t last (wchar_t c) const
size_t last (wchar_t c, size_t) const
size_t last (const wchar_t *str) const
size_t last (const wchar_t *str, size_t len) const
size_t length () const
RWWStringprepend (wchar_t c, size_t count=1)
RWWStringprepend (const wchar_t *str)
RWWStringprepend (const wchar_t *str, size_t len)
RWWStringprepend (const std::wstring &str)
RWWStringprepend (const RWWString &str)
RWWStringprepend (const std::wstring &str, size_t len)
RWWStringprepend (const RWWString &str, size_t len)
std::istream & readFile (std::istream &strm)
std::istream & readLine (std::istream &strm, bool skipWhite=true)
std::istream & readString (std::istream &strm)
std::istream & readToDelim (std::istream &strm)
std::istream & readToDelim (std::istream &strm, wchar_t delim)
std::istream & readToken (std::istream &strm)
std::wistream & readToken (std::wistream &strm)
RWWStringremove (size_t pos)
RWWStringremove (size_t pos, size_t len)
RWWStringreplace (size_t pos, size_t len, const wchar_t *str)
RWWStringreplace (size_t pos, size_t len, const std::wstring &str)
RWWStringreplace (size_t pos, size_t len, const RWWString &str)
RWWStringreplace (size_t pos, size_t len, const wchar_t *str, size_t strLen)
RWWStringreplace (size_t pos, size_t len, const std::wstring &str, size_t strLen)
RWWStringreplace (size_t pos, size_t len, const RWWString &str, size_t strLen)
void resize (size_t len)
size_t rindex (const wchar_t *pat, caseCompare cmp) const
size_t rindex (const wchar_t *pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
size_t rindex (const std::wstring &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
size_t rindex (const RWWString &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
size_t rindex (const wchar_t *pat, size_t patlen, size_t end, caseCompare cmp) const
size_t rindex (const std::wstring &pat, size_t patlen, size_t end, caseCompare cmp) const
size_t rindex (const RWWString &pat, size_t patlen, size_t end, caseCompare cmp) const
RWCString toAscii () const
RWCString toMultiByte () const
void toLower ()
void toUpper ()
bool operator== (const RWWString &rhs) const
bool operator!= (const RWWString &rhs) const
bool operator< (const RWWString &rhs) const
bool operator> (const RWWString &rhs) const

Static Public Member Functions

static RWWString fromAscii (const RWCString &str)
static RWWString fromMultiByte (const RWCString &str)
static unsigned hash (const RWWString &wstr)
static size_t initialCapacity (size_t ic=15)
static size_t maxWaste (size_t)
static size_t resizeIncrement (size_t ri=16)

Friends

RWWString operator+ (const RWWString &lhs, const RWWString &rhs)
RWWString operator+ (const RWWString &lhs, const wchar_t *rhs)
RWWString operator+ (const wchar_t *lhs, const RWWString &rhs)
RWWString operator+ (const std::wstring &lhs, const RWWString &rhs)
RWWString operator+ (const RWWString &lhs, const std::wstring &rhs)

Related Functions

(Note that these are not member functions.)



bool operator<= (const RWWString &rhs) const
bool operator>= (const RWWString &rhs) const
RWWString strXForm (const std::wstring &str)
RWWString strXForm (const RWWString &str)
RWWString toLower (const RWWString &str)
RWWString toUpper (const RWWString &str)
std::ostream & operator<< (std::ostream &os, const RWWString &s)
std::istream & operator>> (std::istream &s, RWWString &str)
RWvistreamoperator>> (RWvistream &str, RWWString &cstr)
RWFileoperator>> (RWFile &file, RWWString &cstr)
RWvostreamoperator<< (RWvostream &vos, const RWWString &str)
RWFileoperator<< (RWFile &file, const RWWString &str)
bool operator== (const RWWString &lhs, const wchar_t *rhs)
bool operator== (const wchar_t *lhs, const RWWString &rhs)
bool operator== (const RWWString &lhs, const std::wstring &rhs)
bool operator== (const std::wstring &lhs, const RWWString &rhs)
bool operator!= (const RWWString &lhs, const wchar_t *rhs)
bool operator!= (const wchar_t *lhs, const RWWString &rhs)
bool operator!= (const RWWString &lhs, const std::wstring &rhs)
bool operator!= (const std::wstring &lhs, const RWWString &rhs)
bool operator< (const RWWString &lhs, const wchar_t *rhs)
bool operator< (const wchar_t *lhs, const RWWString &rhs)
bool operator< (const RWWString &lhs, const std::wstring &rhs)
bool operator< (const std::wstring &lhs, const RWWString &rhs)
bool operator> (const RWWString &lhs, const wchar_t *rhs)
bool operator> (const wchar_t *lhs, const RWWString &rhs)
bool operator> (const RWWString &lhs, const std::wstring &rhs)
bool operator> (const std::wstring &lhs, const RWWString &rhs)
bool operator<= (const RWWString &lhs, const wchar_t *rhs)
bool operator<= (const wchar_t *lhs, const RWWString &rhs)
bool operator<= (const RWWString &lhs, const std::wstring &rhs)
bool operator<= (const std::wstring &lhs, const RWWString &rhs)
bool operator>= (const RWWString &lhs, const wchar_t *rhs)
bool operator>= (const wchar_t *lhs, const RWWString &rhs)
bool operator>= (const RWWString &lhs, const std::wstring &rhs)
bool operator>= (const std::wstring &lhs, const RWWString &rhs)
bool operator== (const RWWSubString &lhs, const RWWString &rhs)
bool operator== (const RWWString &lhs, const RWWSubString &rhs)
bool operator!= (const RWWSubString &lhs, const RWWString &rhs)
bool operator!= (const RWWString &lhs, const RWWSubString &rhs)
bool operator== (const RWWConstSubString &lhs, const RWWString &rhs)
bool operator== (const RWWString &lhs, const RWWConstSubString &rhs)
bool operator!= (const RWWConstSubString &lhs, const RWWString &rhs)
bool operator!= (const RWWString &lhs, const RWWConstSubString &rhs)

Detailed Description

Class RWWString offers very powerful and convenient facilities for manipulating wide character strings.

Note:
RWWString is designed for use with wide character strings. To manipulate multibyte character sequences, use RWCString.

This string class manipulates wide characters of the fundamental type wchar_t. These characters are generally two or four bytes, and can be used to encode richer code sets than the classic char type. Because wchar_t characters are all the same size, indexing is fast.

Conversion to and from multibyte and US-ASCII forms are provided by the RWWString constructors, and by the RWWString member functions isAscii(), toAscii(), and toMultiByte().

Stream operations implicitly translate to and from the multibyte stream representation. That is, on output, wide character strings are converted into multibyte strings, while on input they are converted back into wide character strings. Hence, the external representation of wide character strings is usually as multibyte character strings, saving storage space, and making interfaces with devices (which usually expect multibyte strings) easier.

RWWString tolerates embedded nulls.

Parameters of type const wchar_t* must not be passed a value of zero. This is detected in the debug version of the library.

A separate RWWSubString class supports substring extraction and modification operations. RWWConstSubString supports substring extractions on const RWWString instances.

Synopsis

 #include <rw/wstring.h>
 RWWString a;

Persistence

Simple

Examples

 #include <iostream>
 #include <rw/wstring.h>
 
 int main ()
 {
     RWWString a(L"There is no joy in Beantown");
 
     std::cout << a << std::endl << "becomes......" << std::endl;
 
     a.subString(L"Beantown") = L"Redmond";
 
     std::cout << a << std::endl;
 
     return 0;
 
 }

Program output (assuming your platform displays wide characters as US-ASCII if they are in the US-ASCII character set):

 "There is no joy in Beantown" becomes "There is no joy in Redmond."

Member Typedef Documentation

The immutable substring class associated with RWWString.

The mutable substring class associated with RWWString.


Member Enumeration Documentation

Specifies that a function should assume US-ASCII content when converting from a const char* string.

Enumerator:
ascii 

Convert from US-ASCII.

Specifies semantics used by comparisons, searches, and hashing functions

Enumerator:
exact 

Use exact case sensitive semantics.

ignoreCase 

Ignore case sensitive semantics.

ignoreCaseStrict 

Case-insensitive for alpha characters only. ignoreCaseStrict only differs from ignoreCase in comparison operations, where changing case can affect the order of the strings.

Specifies that a function should assume multibyte content when converting from a const char* string.

Enumerator:
multiByte 

Convert from multibyte.

Specifies how to strip characters from a string. Used by strip().

Enumerator:
leading 

Remove characters at beginning.

trailing 

Remove characters at end.

both 

Remove characters at both ends.


Constructor & Destructor Documentation

RWWString::RWWString (  )  [inline]

Creates a string of length zero (the null string).

RWWString::RWWString ( const std::wstring &  str  )  [inline]

Constructs a string with data copied from str.

RWWString::RWWString ( const RWWString str  )  [inline]

Copy constructor. The created string copies the data from str.

RWWString::RWWString ( RWWString &&  str  )  [inline]

Move constructor. The created string takes ownership of the data owned by str.

Condition:
This method is only available on platforms with rvalue reference support.
RWWString::RWWString ( RWSize_T  cap  )  [inline]

Creates a string of length zero (the null string). The string's capacity (that is, the size it can grow to without resizing) is given by the parameter cap. We recommend creating an RWSize_T value from a numerical constant to pass into this constructor. While RWSize_T knows how to convert size_t values to itself, conforming compilers choose the conversion to char instead.

RWWString::RWWString ( wchar_t  c  )  [inline]

Constructs a string containing the single character c.

RWWString::RWWString ( wchar_t  c,
size_t  count 
) [inline]

Constructs a string containing the character c repeated count times.

RWWString::RWWString ( const wchar_t *  str  )  [inline]

Converts from the null-terminated wide character string str. The created string copies the data pointed to by str, up to the first terminating null.

Note:
This function is incompatible with str strings with embedded nulls.
RWWString::RWWString ( const wchar_t *  str,
size_t  len 
) [inline]

Constructs a string from the character string str. The created string copies the data pointed to by str. Exactly len characters are copied, including any embedded nulls. Hence, the buffer pointed to by str must be at least len * sizeof(wchar_t) bytes or len wide characters long.

RWWString::RWWString ( char  c  )  [inline]

Constructs a string containing the single character c. The character c is widened to a wchar_t.

RWWString::RWWString ( char  c,
size_t  count 
) [inline]

Constructs a string containing the character c repeated count times. The character c is widened to a wchar_t.

RWWString::RWWString ( signed char  c  )  [inline]

Constructs a string containing the single signed character c. The character c is widened to a wchar_t.

RWWString::RWWString ( unsigned char  c  )  [inline]

Constructs a string containing the single unsigned character c. The character c is widened to a wchar_t.

RWWString::RWWString ( const char *  str,
ascii_   
) [inline]

Constructs a wide character string from the US-ASCII character string contained in str.

For this conversion to be successful, the string must contain only US-ASCII characters. This can be confirmed (if necessary) using RWCString::isAscii(). If str contains non-US-ASCII characters, the RWWString(const char*,multiByte_) constructor should be used instead.

This constructor can be used as follows:

 RWWString a("An US-ASCII character string", RWWString::ascii);
RWWString::RWWString ( const RWCString str,
ascii_   
)

Constructs a wide character string from the US-ASCII character string contained in str.For this conversion to be successful, the string must contain only US-ASCII characters. This can be confirmed (if necessary) using RWCString::isAscii(). If str contains non-US-ASCII characters, the RWWString(const char*,multiByte_) constructor should be used instead.This constructor can be used as follows:

 RWWString a("An US-ASCII character string", RWWString::ascii);

RWWString::RWWString ( const char *  str,
multiByte_   
) [inline]

Constructs a wide character string from the multibyte character string contained in str. The conversion is done using the Standard C Library function mbstowcs().

This constructor can be used as follows:

 RWWString a("\306\374\315\313\306\374", multiByte);
RWWString::RWWString ( const RWCString str,
multiByte_   
)

Constructs a wide character string from the multibyte character string contained in str. The conversion is done using the Standard C Library function mbstowcs().This constructor can be used as follows:

 RWWString a("\306\374\315\313\306\374", multiByte);

RWWString::RWWString ( const char *  str,
size_t  len,
ascii_   
) [inline]

Constructs a wide character string from the US-ASCII character string contained in str, copying exactly len characters including any embedded nulls. Hence, the buffer pointed to by str must be long enough to hold len characters.

RWWString::RWWString ( const char *  str,
size_t  len,
multiByte_   
) [inline]

Constructs a wide character string from the multibyte character string contained in str, copying exactly len characters including any embedded nulls. Hence, the buffer pointed to by str must be long enough to hold len characters.

RWWString::RWWString ( const SubString str  )  [inline]

Converts from substring. The created string copies the substring represented by str.

RWWString::RWWString ( const ConstSubString str  )  [inline]

Converts from substring. The created wide string copies the substring represented by str.


Member Function Documentation

RWWString & RWWString::append ( const RWWString str,
size_t  len 
) [inline]

Appends the first len characters of str to self. If len is greater than the length of str, the entire string is appended. Returns a reference to self.

RWWString & RWWString::append ( const std::wstring &  str,
size_t  len 
) [inline]

Appends the first len characters of str to self. If len is greater than the length of str, the entire string is appended. Returns a reference to self.

RWWString & RWWString::append ( const RWWString str  )  [inline]

Appends a copy of the string str to self. Returns a reference to self.

RWWString & RWWString::append ( const std::wstring &  str  )  [inline]

Appends a copy of the string str to self. Returns a reference to self.

RWWString & RWWString::append ( const wchar_t *  str,
size_t  len 
) [inline]

Appends a copy of the wide character string str to self. Exactly len characters are copied, including any embedded nulls. Hence, the buffer pointed to by str must be at least len characters long. Returns a reference to self.

RWWString & RWWString::append ( const wchar_t *  str  )  [inline]

Appends a copy of the null-terminated wide character string pointed to by str to self. Returns a reference to self.

Note:
This function is incompatible with str strings with embedded nulls.
RWWString & RWWString::append ( wchar_t  c,
size_t  count = 1 
) [inline]

Appends count copies of the character c to self. Returns a reference to self.

RWspace RWWString::binaryStoreSize (  )  const [inline]

Returns the number of bytes necessary to store the object using the global function:

Reimplemented in RWCollectableWString.

size_t RWWString::capacity ( size_t  cap  )  [inline]

A non-binding request to alter the capacity of self to cap. The capacity is never reduced below the current number of characters. Returns the actual capacity.

size_t RWWString::capacity (  )  const [inline]

Returns the current capacity of self. This is the number of characters the string can hold without resizing.

int RWWString::collate ( const RWWString str  )  const [inline]

Returns an int less than, greater than, or equal to zero, according to the result of calling the POSIX function wscoll() on self and the argument str. This method supports locale-dependent collation.

Note:
This function is incompatible with str strings with embedded nulls.

int RWWString::collate ( const std::wstring &  str  )  const [inline]

Returns an int less than, greater than, or equal to zero, according to the result of calling the POSIX function wscoll() on self and the argument str. This method supports locale-dependent collation.

Note:
This function is incompatible with str strings with embedded nulls.

int RWWString::collate ( const wchar_t *  str  )  const [inline]

Returns an int less than, greater than, or equal to zero, according to the result of calling the POSIX function wscoll() on self and the argument str. This method supports locale-dependent collation.

Note:
This function is incompatible with str strings with embedded nulls.
int RWWString::compareTo ( const RWWString str,
caseCompare  cmp = exact 
) const [inline]

This function is the equivalent of calling:

 RWWString::compareTo(*str, cmp);
int RWWString::compareTo ( const RWWString str,
caseCompare  cmp = exact 
) const [inline]

Lexicographically compares self to str. Returns the following values based on the results of the comparison:

<0self precedes str.
0self is equal to str.
>0self follows str.

If cmp is either RWCString::ignoreCase or RWCString::ignoreCaseStrict, the strings are normalized before they are compared.

Reimplemented in RWCollectableWString.

int RWWString::compareTo ( const std::wstring *  str,
caseCompare  cmp = exact 
) const [inline]

This function is the equivalent of calling:

 RWWString::compareTo(*str, cmp);

int RWWString::compareTo ( const std::wstring &  str,
caseCompare  cmp = exact 
) const [inline]

Lexicographically compares self to str. Returns the following values based on the results of the comparison:
<0self precedes str.
0self is equal to str.
>0self follows str.
If cmp is either RWCString::ignoreCase or RWCString::ignoreCaseStrict, the strings are normalized before they are compared.

int RWWString::compareTo ( const wchar_t *  str,
caseCompare  cmp = exact 
) const [inline]

Lexicographically compares self to str. Returns the following values based on the results of the comparison:
<0self precedes str.
0self is equal to str.
>0self follows str.
If cmp is either RWCString::ignoreCase or RWCString::ignoreCaseStrict, the strings are normalized before they are compared.

Note:
This function is incompatible with str strings with embedded nulls.

Reimplemented in RWCollectableWString.

bool RWWString::contains ( const RWWString str,
caseCompare  cmp = exact 
) const [inline]

Returns false if RWWString::index(str, cmp) returns RW_NPOS, otherwise returns true.

bool RWWString::contains ( const std::wstring &  str,
caseCompare  cmp = exact 
) const [inline]

Returns false if RWWString::index(str, cmp) returns RW_NPOS, otherwise returns true.

bool RWWString::contains ( const wchar_t *  str,
caseCompare  cmp = exact 
) const [inline]

Returns false if RWWString::index(str, cmp) returns RW_NPOS, otherwise returns true.

const wchar_t* RWWString::data ( void   )  const [inline]

Provides access to the RWWString instances's data as a null-terminated string. This datum is owned by the RWWString and may not be deleted or changed. If the RWWString object itself changes or goes out of scope, the pointer value previously returned becomes invalid. While the string is null-terminated, note that its length is still given by the member function length(). That is, it may contain embedded nulls.

size_t RWWString::first ( const wchar_t *  str,
size_t  len 
) const [inline]

Returns the index of the first occurrence in self of any character in str. Exactly len characters in str are checked including any embedded nulls so str must point to a buffer containing at least len characters. Returns RW_NPOS if there is no match.

size_t RWWString::first ( const wchar_t *  str  )  const [inline]

Returns the index of the first occurrence in self of any character in str. Returns RW_NPOS if there is no match.

Note:
This function is incompatible with str strings with embedded nulls.
size_t RWWString::first ( wchar_t  c,
size_t   
) const [inline]
Deprecated:
Use RWWString::first(wchar_t) instead.
size_t RWWString::first ( wchar_t  c  )  const [inline]

Returns the index of the first occurrence of the character c in self. Returns RW_NPOS if there is no match.

static RWWString RWWString::fromAscii ( const RWCString str  )  [inline, static]

Returns the result of the constructor RWWString::RWWString(const RWCString&, RWWString::ascii).

static RWWString RWWString::fromMultiByte ( const RWCString str  )  [inline, static]

Returns the result of the constructor RWWString::RWWString(const RWCString&, RWWString::multiByte).

static unsigned RWWString::hash ( const RWWString wstr  )  [inline, static]

Returns the hash value of str as returned by hash(caseCompare) const, where caseCompare is RWWString::exact.

Reimplemented in RWCollectableWString.

unsigned long RWWString::hash ( caseCompare  cmp = exact  )  const

Returns a suitable hash value.

Reimplemented in RWCollectableWString.

size_t RWWString::index ( const RWWString pat,
size_t  patlen,
size_t  start,
caseCompare  cmp 
) const [inline]

Pattern matching. Starting with index start, searches for the first occurrence of the first patlen characters from pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

size_t RWWString::index ( const std::wstring &  pat,
size_t  patlen,
size_t  start,
caseCompare  cmp 
) const [inline]

Pattern matching. Starting with index start, searches for the first occurrence of the first patlen characters from pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

size_t RWWString::index ( const wchar_t *  pat,
size_t  patlen,
size_t  start,
caseCompare  cmp 
) const [inline]

Pattern matching. Starting with index start, searches for the first occurrence of the first patlen characters from pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

size_t RWWString::index ( const RWWString pat,
size_t  start = 0,
caseCompare  cmp = exact 
) const [inline]

Pattern matching. Starting with index start, searches for the first occurrence of pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

size_t RWWString::index ( const std::wstring &  pat,
size_t  start = 0,
caseCompare  cmp = exact 
) const [inline]

Pattern matching. Starting with index start, searches for the first occurrence of pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

size_t RWWString::index ( const wchar_t *  pat,
size_t  start = 0,
caseCompare  cmp = exact 
) const [inline]

Pattern matching. Starting with index start, searches for the first occurrence of the null-terminated string pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note:
This function is incompatible with pat strings with embedded nulls.
static size_t RWWString::initialCapacity ( size_t  ic = 15  )  [inline, static]
Deprecated:
This method is deprecated and is provided only for API compatability. It has no effect on an RWWString instance and may be removed from a future release.
RWWString & RWWString::insert ( size_t  pos,
const RWWString str,
size_t  len 
) [inline]

Inserts the first len characters of str into self at index pos. If len is greater than the length of str, the entire string is inserted. Returns a reference to self.

RWWString & RWWString::insert ( size_t  pos,
const std::wstring &  str,
size_t  len 
) [inline]

Inserts the first len characters of str into self at index pos. If len is greater than the length of str, the entire string is inserted. Returns a reference to self.

RWWString & RWWString::insert ( size_t  pos,
const RWWString str 
) [inline]

Inserts a copy of the string str into self at index pos. Returns a reference to self.

RWWString & RWWString::insert ( size_t  pos,
const std::wstring &  str 
) [inline]

Inserts a copy of the string str into self at index pos. Returns a reference to self.

RWWString & RWWString::insert ( size_t  pos,
const wchar_t *  str,
size_t  len 
) [inline]

Inserts a copy of the first len characters of str into self at index pos. Returns a reference to self.

RWWString & RWWString::insert ( size_t  pos,
const wchar_t *  str 
) [inline]

Inserts a copy of the null-terminated string str into self at index pos. Returns a reference to self.

Note:
This function is incompatible with str strings with embedded nulls.
RWWString & RWWString::insert ( size_t  pos,
wchar_t  c,
size_t  count 
) [inline]

Inserts count instances of the character c into self at index pos. Returns a reference to self.

bool RWWString::isAscii (  )  const

Returns true if it is safe to perform the conversion toAscii() (that is, if all characters of self are US-ASCII characters).

bool RWWString::isNull ( void   )  const [inline]

Returns true if this string has zero length (i.e., the null string).

size_t RWWString::last ( const wchar_t *  str,
size_t  len 
) const [inline]

Returns the index of the last occurrence in self of any character in str. Exactly len characters in str are checked including any embedded nulls so str must point to a buffer containing at least len characters. Returns RW_NPOS if there is no match.

size_t RWWString::last ( const wchar_t *  str  )  const [inline]

Returns the index of the last occurrence in self of any character in str. Returns RW_NPOS if there is no match.

Note:
This function is incompatible with str strings with embedded nulls.
size_t RWWString::last ( wchar_t  c,
size_t   
) const [inline]
Deprecated:
Use RWWString::last(char) instead.
size_t RWWString::last ( wchar_t  c  )  const [inline]

Returns the index of the last occurrence of the character c in self. Returns RW_NPOS if there is no match.

size_t RWWString::length (  )  const [inline]

Returns the number of characters in self.

static size_t RWWString::maxWaste ( size_t   )  [inline, static]
Deprecated:
This method is deprecated and is provided only for API compatability. It has no effect on an RWWString instance and may be removed from a future release.
RWWString::operator const wchar_t * (  )  const [inline]

The equivalent of calling RWWString::data() on self.

bool RWWString::operator!= ( const RWWString rhs  )  const [inline]

The equivalent of calling:

 !(*this == rhs)
RWWConstSubString RWWString::operator() ( size_t  start,
size_t  len 
) const [inline]

Substring operator. Returns a substring of self with length len, starting at index start.The sum of start plus len must be less than or equal to the string length.

Exceptions:
RWBoundsErr if the library was built using the RW_DEBUG flag, and start and len are out of range.
RWWSubString RWWString::operator() ( size_t  start,
size_t  len 
) [inline]

Substring operator. Returns a substring of self with length len, starting at index start. The sum of start plus len must be less than or equal to the string length.

Exceptions:
RWBoundsErr if the library was built using the RW_DEBUG flag, and start and len are out of range.
wchar_t RWWString::operator() ( size_t  i  )  const [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. Bounds checking is performed if the pre-processor macro RWBOUNDS_CHECK has been defined before including <rw/wstring.h>.

Exceptions:
RWBoundsErr if RWBOUNDS_CHECK is defined and the index is out of range.
wchar_t & RWWString::operator() ( size_t  i  )  [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. Bounds checking is performed if the pre-processor macro RWBOUNDS_CHECK has been defined before including <rw/wstring.h>.

Exceptions:
RWBoundsErr if RWBOUNDS_CHECK is defined and the index is out of range.
RWWString& RWWString::operator+= ( const RWWString str  )  [inline]

Appends the string str to self. Returns a reference to self.

RWWString& RWWString::operator+= ( const std::wstring &  str  )  [inline]

Appends the string str to self. Returns a reference to self.

RWWString& RWWString::operator+= ( const wchar_t *  str  )  [inline]

Appends the null-terminated character string pointed to by str to self. Returns a reference to self.

Note:
This function is incompatible with str strings with embedded nulls.
RWWString& RWWString::operator+= ( wchar_t  c  )  [inline]

Appends the character c to self. Returns a reference to self.

bool RWWString::operator< ( const RWWString rhs  )  const [inline]

Returns true if this lexicographically precedes rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

RWWString & RWWString::operator= ( RWWString &&  str  )  [inline]

Move assignment. Self takes ownership of the data owned by str.

Condition:
This method is only available on platforms with rvalue reference support.
RWWString & RWWString::operator= ( const RWWString str  )  [inline]

Assignment operator. The string copies the data from str. Returns a reference to self.

RWWString & RWWString::operator= ( const std::wstring &  str  )  [inline]

Assignment operator. The string copies the data from str. Returns a reference to self.

RWWString & RWWString::operator= ( const wchar_t *  str  )  [inline]

Assignment operator. Copies the null-terminated character string pointed to by str into self. Returns a reference to self.

Note:
This function is incompatible with str strings with embedded nulls.
RWWString & RWWString::operator= ( wchar_t  c  )  [inline]

Assignment operator. Copies the character c into self. Returns a reference to self.

bool RWWString::operator== ( const RWWString rhs  )  const [inline]

Returns true if this is lexicographically equal to rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

bool RWWString::operator> ( const RWWString rhs  )  const [inline]

The equivalent of calling:

 !(rhs < *this)
wchar_t RWWString::operator[] ( unsigned long long  i  )  const [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t RWWString::operator[] ( long long  i  )  const [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t & RWWString::operator[] ( unsigned long long  i  )  [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t & RWWString::operator[] ( long long  i  )  [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t RWWString::operator[] ( unsigned long  i  )  const [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t RWWString::operator[] ( unsigned int  i  )  const [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t RWWString::operator[] ( unsigned short  i  )  const [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t RWWString::operator[] ( long  i  )  const [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t RWWString::operator[] ( int  i  )  const [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t RWWString::operator[] ( short  i  )  const [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t & RWWString::operator[] ( unsigned long  i  )  [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t & RWWString::operator[] ( unsigned int  i  )  [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t & RWWString::operator[] ( unsigned short  i  )  [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t & RWWString::operator[] ( long  i  )  [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t & RWWString::operator[] ( int  i  )  [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.

wchar_t & RWWString::operator[] ( short  i  )  [inline]

Returns the i th character in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions:
RWBoundsErr if the index is out of range.
RWWString & RWWString::prepend ( const RWWString str,
size_t  len 
) [inline]

Prepends the first len characters of str to self. If len is greater than the length of str, the entire string is prepended. Returns a reference to self.

RWWString & RWWString::prepend ( const std::wstring &  str,
size_t  len 
) [inline]

Prepends the first len characters of str to self. If len is greater than the length of str, the entire string is prepended. Returns a reference to self.

RWWString & RWWString::prepend ( const RWWString str  )  [inline]

Prepends a copy of the string str to self. Returns a reference to self.

RWWString & RWWString::prepend ( const std::wstring &  str  )  [inline]

Prepends a copy of the string str to self. Returns a reference to self.

RWWString & RWWString::prepend ( const wchar_t *  str,
size_t  len 
) [inline]

Prepends a copy of the character string str to self. Exactly len characters are copied, including any embedded nulls. Hence, the buffer pointed to by str must be at least len characters long. Returns a reference to self.

RWWString & RWWString::prepend ( const wchar_t *  str  )  [inline]

Prepends a copy of the null-terminated character string pointed to by str to self. Returns a reference to self.

Note:
This function is incompatible with str strings with embedded nulls.
RWWString & RWWString::prepend ( wchar_t  c,
size_t  count = 1 
) [inline]

Prepends count copies of character c to self. Returns a reference to self.

std::istream& RWWString::readFile ( std::istream &  strm  ) 

Reads characters from the input stream strm, replacing the previous contents of self, until EOF is reached. The input stream is treated as a sequence of wide characters, each of which is read and stored in the RWWString object. Null characters are treated the same as other characters.

Note:
RWWString is designed for use with wide character strings; to manipulate multibyte character sequences, use RWCString.
std::istream & RWWString::readLine ( std::istream &  strm,
bool  skipWhite = true 
) [inline]

Reads characters from the input stream strm, replacing the previous contents of self, until a newline (or an EOF) is encountered. The newline is removed from the input stream but is not stored. The input stream is treated as a sequence of wide characters, each of which is read and stored in the RWWString object. Null characters are treated the same as other characters. If the skipWhite argument is true, then whitespace is skipped (using the iostream library manipulator ws) before saving characters.

Note:
RWWString is designed for use with wide character strings; to manipulate multibyte character sequences, use RWCString.
std::istream & RWWString::readString ( std::istream &  strm  )  [inline]

Reads characters from the input stream strm, replacing the previous contents of self, until an EOF or null terminator is encountered. The input stream is treated as a sequence of wide characters, each of which is read and stored in the RWWString object.

Note:
RWWString is designed for use with wide character strings; to manipulate multibyte character sequences, use RWCString.
std::istream& RWWString::readToDelim ( std::istream &  strm,
wchar_t  delim 
) [inline]

Reads characters from the input stream strm, replacing the previous contents of self, until an EOF or the delimiting character delim is encountered. The delimiter is removed from the input stream but is not stored. The input stream is treated as a sequence of wide characters, each of which is read and stored in the RWWString object. Null characters are treated the same as other characters.

Note:
RWWString is designed for use with wide character strings; to manipulate multibyte character sequences, use RWCString.
std::istream& RWWString::readToDelim ( std::istream &  strm  )  [inline]

The equivalant of calling:

 RWWString::readToDelim(strm, L'\n');
std::wistream & RWWString::readToken ( std::wistream &  strm  )  [inline]

White space is skipped before reading from strm. Characters are then read from the input stream strm, replacing previous contents of self, until trailing white space or EOF is encountered. The white space is left on the input stream. Null characters are treated the same as other characters. White space is identified by the Standard C Library function isspace().

std::istream& RWWString::readToken ( std::istream &  strm  ) 

Whitespace is skipped before storing characters into a wide string. Characters are then read from the input stream strm, replacing previous contents of self, until trailing whitespace or an EOF is encountered. The trailing whitespace is left on the input stream. Only US-ASCII whitespace characters are recognized, as defined by the Standard C Library function isspace(). The input stream is treated as a sequence of wide characters, each of which is read and stored in the RWWString object.

Note:
RWWString is designed for use with wide character strings; to manipulate multibyte character sequences, use RWCString.
RWWString & RWWString::remove ( size_t  pos,
size_t  len 
) [inline]

Removes len wide characters or to the end of string (whichever comes first) starting at the position pos, which must be no greater than length(). Returns a reference to self.

RWWString & RWWString::remove ( size_t  pos  )  [inline]

Removes the characters to the end of string, starting at the position pos, which must be no greater than length(). Returns a reference to self.

RWWString & RWWString::replace ( size_t  pos,
size_t  len,
const RWWString str,
size_t  strLen 
) [inline]

Replaces the substring beginning at pos and of length len with the first strLen characters of string str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string. If strLen is greater than the length of str, all of str is used.

Returns a reference to self.

Exceptions:
RWBoundsErr If pos is greater than the length of self.
RWWString & RWWString::replace ( size_t  pos,
size_t  len,
const std::wstring &  str,
size_t  strLen 
) [inline]

Replaces the substring beginning at pos and of length len with the first strLen characters of string str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string. If strLen is greater than the length of str, all of str is used.Returns a reference to self.

Exceptions:
RWBoundsErr If pos is greater than the length of self.

RWWString & RWWString::replace ( size_t  pos,
size_t  len,
const wchar_t *  str,
size_t  strLen 
) [inline]

Replaces the substring beginning at pos and of length len with strLen characters from str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string.

Returns a reference to self.

Exceptions:
RWBoundsErr If pos is greater than the length of self.
RWWString & RWWString::replace ( size_t  pos,
size_t  len,
const RWWString str 
) [inline]

Replaces the substring beginning at pos and of length len with the string str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string.

Returns a reference to self.

Exceptions:
RWBoundsErr If pos is greater than the length of self.
RWWString & RWWString::replace ( size_t  pos,
size_t  len,
const std::wstring &  str 
) [inline]

Replaces the substring beginning at pos and of length len with the string str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string.Returns a reference to self.

Exceptions:
RWBoundsErr If pos is greater than the length of self.

RWWString & RWWString::replace ( size_t  pos,
size_t  len,
const wchar_t *  str 
) [inline]

Replaces the substring beginning at pos and of length len with the null-terminated string str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string.

Returns a reference to self.

Note:
This function is incompatible with str strings with embedded nulls.
Exceptions:
RWBoundsErr If pos is greater than the length of self.
void RWWString::resize ( size_t  len  )  [inline]

Changes the length of self to len characters, adding blanks (i.e., L' ') or truncating as necessary.

static size_t RWWString::resizeIncrement ( size_t  ri = 16  )  [inline, static]
Deprecated:
This method is deprecated and is provided only for API compatability. It has no effect on an RWWString instance and may be removed from a future release.
size_t RWWString::rindex ( const RWWString pat,
size_t  patlen,
size_t  end,
caseCompare  cmp 
) const [inline]

Pattern matching. Searches for the last occurrence of the first patlen characters from pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note:
  • This member function is unavailable on RWWString if RW_COPY_ON_WRITE_STRING is defined.
  • This member function is unavailable on RWCopyOnWriteWString
size_t RWWString::rindex ( const std::wstring &  pat,
size_t  patlen,
size_t  end,
caseCompare  cmp 
) const [inline]

Pattern matching. Searches for the last occurrence of the first patlen characters from pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note:
  • This member function is unavailable on RWWString if RW_COPY_ON_WRITE_STRING is defined.
  • This member function is unavailable on RWCopyOnWriteWString

size_t RWWString::rindex ( const wchar_t *  pat,
size_t  patlen,
size_t  end,
caseCompare  cmp 
) const [inline]

Pattern matching. Searches for the last occurrence of the first patlen characters from pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note:
  • This member function is unavailable on RWWString if RW_COPY_ON_WRITE_STRING is defined.
  • This member function is unavailable on RWCopyOnWriteWString

size_t RWWString::rindex ( const RWWString pat,
size_t  end = RW_NPOS,
caseCompare  cmp = exact 
) const [inline]

Pattern matching. Searches for the last occurrence of pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note:
  • This member function is unavailable on RWWString if RW_COPY_ON_WRITE_STRING is defined.
  • This member function is unavailable on RWCopyOnWriteWString
size_t RWWString::rindex ( const std::wstring &  pat,
size_t  end = RW_NPOS,
caseCompare  cmp = exact 
) const [inline]

Pattern matching. Searches for the last occurrence of pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note:
  • This member function is unavailable on RWWString if RW_COPY_ON_WRITE_STRING is defined.
  • This member function is unavailable on RWCopyOnWriteWString

size_t RWWString::rindex ( const wchar_t *  pat,
size_t  end = RW_NPOS,
caseCompare  cmp = exact 
) const [inline]

Pattern matching. Searches for the last occurrence of the null-terminated string pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note:
This function is incompatible with pat strings with embedded nulls.
  • This member function is unavailable on RWWString if RW_COPY_ON_WRITE_STRING is defined.
  • This member function is unavailable on RWCopyOnWriteWString
size_t RWWString::rindex ( const wchar_t *  pat,
caseCompare  cmp 
) const [inline]

Pattern matching. Searches for the last occurrence of the null-terminated string pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note:
This function is incompatible with pat strings with embedded nulls.
  • This member function is unavailable on RWWString if RW_COPY_ON_WRITE_STRING is defined.
  • This member function is unavailable on RWCopyOnWriteWString
const std::wstring& RWWString::std (  )  const [inline]

Returns the underlying std::wstring representation of self.

Note:
  • This member function is unavailable on RWWString if RW_COPY_ON_WRITE_STRING is defined.
  • This member function is unavailable on RWCopyOnWriteWString
std::wstring& RWWString::std (  ) 

Returns the underlying std::wstring representation of self.

Note:
  • This member function is unavailable on RWWString if RW_COPY_ON_WRITE_STRING is defined.
  • This member function is unavailable on RWCopyOnWriteWString
ConstSubString RWWString::strip ( stripType  st = trailing,
wchar_t  c = L' ' 
) const

Returns a substring of self where the character c has been stripped off the beginning, end, or both ends of the string, depending on st.

SubString RWWString::strip ( stripType  st = trailing,
wchar_t  c = L' ' 
)

Returns a substring of self where the character c has been stripped off the beginning, end, or both ends of the string, depending on st.

ConstSubString RWWString::subString ( const wchar_t *  pat,
size_t  start = 0,
caseCompare  cmp = exact 
) const

Starting at start, returns a substring representing the first occurrence of the null-terminated string pat in self. If pat is not found, a null substring instance is returned.

Note:
This function is incompatible with pat strings with embedded nulls.

SubString RWWString::subString ( const wchar_t *  pat,
size_t  start = 0,
caseCompare  cmp = exact 
)

Starting at start, returns a substring representing the first occurrence of the null-terminated string pat in self. If pat is not found, a null substring instance is returned.

Note:
This function is incompatible with pat strings with embedded nulls.
void RWWString::swap ( RWWString str  )  [inline]

Swaps the contents of str with self.

RWCString RWWString::toAscii (  )  const

Returns an ASCII representation of self. Any non-US-ASCII characters in self simply have the high bits stripped off. Use isAscii() to determine whether this function is safe to use.

void RWWString::toLower (  )  [inline]

Changes all upper-case letters in self to lower-case. Uses the C library function towlower().

RWCString RWWString::toMultiByte (  )  const

Returns a multibyte representation of self.

Note:
This method does not handle embedded nulls on systems where wcstombs() doesn't handle them. Returns an empty string if the wide string cannot be translated (for instance, if the correct locale is not set to convert a specific character).
void RWWString::toUpper (  )  [inline]

Changes all lower-case letters in self to upper-case. Uses the C library function towupper().


Friends And Related Function Documentation

bool operator!= ( const RWWString lhs,
const RWWConstSubString rhs 
) [related]

The equivalent of calling:

 !(lhs == rhs)

bool operator!= ( const RWWConstSubString lhs,
const RWWString rhs 
) [related]

The equivalent of calling:

 !(lhs == rhs)

bool operator!= ( const RWWString lhs,
const RWWSubString rhs 
) [related]

The equivalent of calling:

 !(lhs == rhs)

bool operator!= ( const RWWSubString lhs,
const RWWString rhs 
) [related]

The equivalent of calling:

 !(lhs == rhs)

bool operator!= ( const std::wstring &  lhs,
const RWWString rhs 
) [related]

The equivalent of calling:

 !(lhs == rhs)

bool operator!= ( const RWWString lhs,
const std::wstring &  rhs 
) [related]

The equivalent of calling:

 !(lhs == rhs)

bool operator!= ( const wchar_t *  lhs,
const RWWString rhs 
) [related]

The equivalent of calling:

 !(lhs == rhs)

bool operator!= ( const RWWString lhs,
const wchar_t *  rhs 
) [related]

The equivalent of calling:

 !(lhs == rhs)
RWWString operator+ ( const RWWString lhs,
const std::wstring &  rhs 
) [friend]

Concatenates lhs and rhs and returns the resulting string.

RWWString operator+ ( const std::wstring &  lhs,
const RWWString rhs 
) [friend]

Concatenates lhs and rhs and returns the resulting string.

RWWString operator+ ( const wchar_t *  lhs,
const RWWString rhs 
) [friend]

Concatenates the null-terminated string lhs and rhs and returns the resulting string.

Note:
This function is incompatible with lhs strings with embedded nulls.
RWWString operator+ ( const RWWString lhs,
const wchar_t *  rhs 
) [friend]

Concatenates lhs and the null-terminated string rhs and returns the resulting string.

Note:
This function is incompatible with rhs strings with embedded nulls.
RWWString operator+ ( const RWWString lhs,
const RWWString rhs 
) [friend]

Concatenates lhs and rhs and returns the resulting string.

bool operator< ( const std::wstring &  lhs,
const RWWString rhs 
) [related]

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

bool operator< ( const RWWString lhs,
const std::wstring &  rhs 
) [related]

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

bool operator< ( const wchar_t *  lhs,
const RWWString rhs 
) [related]

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

bool operator< ( const RWWString lhs,
const wchar_t *  rhs 
) [related]

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

RWFile & operator<< ( RWFile file,
const RWWString str 
) [related]

Saves string str to an RWFile.

RWvostream & operator<< ( RWvostream vos,
const RWWString str 
) [related]

Saves string str to a virtual stream.

std::ostream & operator<< ( std::ostream &  os,
const RWWString s 
) [related]

Outputs an RWWString on ostream os as a sequence of bytes. This is done literally from the byte content of the characters.

bool operator<= ( const std::wstring &  lhs,
const RWWString rhs 
) [related]

The equivalent of calling:

 !(rhs < lhs)

bool operator<= ( const RWWString lhs,
const std::wstring &  rhs 
) [related]

The equivalent of calling:

 !(rhs < lhs)

bool operator<= ( const wchar_t *  lhs,
const RWWString rhs 
) [related]

The equivalent of calling:

 !(rhs < lhs)

bool operator<= ( const RWWString lhs,
const wchar_t *  rhs 
) [related]

The equivalent of calling:

 !(rhs < lhs)
bool operator<= ( const RWWString rhs  )  const [related]

The equivalent of calling:

 !(rhs < *this)
bool operator== ( const RWWString lhs,
const RWWConstSubString rhs 
) [related]

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

bool operator== ( const RWWConstSubString lhs,
const RWWString rhs 
) [related]

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

bool operator== ( const RWWString lhs,
const RWWSubString rhs 
) [related]

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

bool operator== ( const RWWSubString lhs,
const RWWString rhs 
) [related]

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

bool operator== ( const std::wstring &  lhs,
const RWWString rhs 
) [related]

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

bool operator== ( const RWWString lhs,
const std::wstring &  rhs 
) [related]

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

bool operator== ( const wchar_t *  lhs,
const RWWString rhs 
) [related]

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

bool operator== ( const RWWString lhs,
const wchar_t *  rhs 
) [related]

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.

bool operator> ( const std::wstring &  lhs,
const RWWString rhs 
) [related]

The equivalent of calling:

 !(rhs < lhs)

bool operator> ( const RWWString lhs,
const std::wstring &  rhs 
) [related]

The equivalent of calling:

 !(rhs < lhs)

bool operator> ( const wchar_t *  lhs,
const RWWString rhs 
) [related]

The equivalent of calling:

 !(rhs < lhs)

bool operator> ( const RWWString lhs,
const wchar_t *  rhs 
) [related]

The equivalent of calling:

 !(rhs < lhs)
bool operator>= ( const std::wstring &  lhs,
const RWWString rhs 
) [related]

The equivalent of calling:

 !(lhs < rhs)

bool operator>= ( const RWWString lhs,
const std::wstring &  rhs 
) [related]

The equivalent of calling:

 !(lhs < rhs)

bool operator>= ( const wchar_t *  lhs,
const RWWString rhs 
) [related]

The equivalent of calling:

 !(lhs < rhs)

bool operator>= ( const RWWString lhs,
const wchar_t *  rhs 
) [related]

The equivalent of calling:

 !(lhs < rhs)
bool operator>= ( const RWWString rhs  )  const [related]

The equivalent of calling:

 !(*this < rhs)
RWFile & operator>> ( RWFile file,
RWWString cstr 
) [related]

Restores a wide character string into cstr from an RWFile, replacing the previous contents of cstr.

If an error occurs while extracting the string, the operator returns the original string contents unmodified. Check the file to determine if an error occurred on extraction.

RWvistream & operator>> ( RWvistream str,
RWWString cstr 
) [related]

Restores a wide character string into cstr from a virtual stream, replacing the previous contents of cstr.

If an error occurs while extracting the string, the operator returns the original string contents unmodified. Check the virtual stream to determine if an error occurred on extraction.

std::istream & operator>> ( std::istream &  s,
RWWString str 
) [related]

Calls str.readToken(s). That is, a token is read from the input stream s.

RWWString strXForm ( const RWWString str  )  [related]

Returns the result of applying wsxfrm() to str to allow quicker collation than RWWString::collate(). Provided only on platforms that provide wsxfrm().

Note:
This function is incompatible with str strings with embedded nulls.
RWWString strXForm ( const std::wstring &  str  )  [related]
RWWString toLower ( const RWWString str  )  [related]

Returns a copy of str with all upper-case characters replaced with lower-case characters. This function is the equivalent of calling:

 RWWString tmp(str);
 tmp.toLower();
RWWString toUpper ( const RWWString str  )  [related]

Returns a copy of str with all lower-case characters replaced with upper-case characters. This function is the equivalent of calling:

 RWWString tmp(str);
 tmp.toUpper();
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.