Tools.h++ Class Reference

Table Of Contents
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
RWWString
Synopsis
Description
Persistence
Example
Enumerations
Public Constructors
Type Conversion
Assignment Operators
Indexing Operators
Public Member Functions
Static Public Member Functions
Related Global Operators
Related Global Functions
Synopsis
#include <rw/wstring.h>
RWWString a;
Description
Class RWWString offers very powerful and convenient facilities for manipulating wide character strings.
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 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.
RWWStrings tolerate 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.
The class is implemented using a technique called copy on write. With this technique, the copy constructor and