Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWDBMBString


RWDBMBString RWCString

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <rw/db/mbstring.h>
RWDBMBString a;

Description

Class RWDBMBString is a simple wrapper around the Tools.h++ class RWCString. Some databases require different handling of single byte character sets (SBCS), like ASCII or ISO Latin-1, and multibyte character sets (MBCS). Writing applications using class RWDBMBString for MBCS strings and class RWCString for SBCS strings allows DBTools.h++ to make the critical differentiation.

Since RWDBMBString derives publicly from RWCString, all the facilities and functions of RWCString are available. For a complete description of those functions, see the Tools.h++ documentation for class RWCString.

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

Class RWDBMBString is implemented using a technique called copy on write. With this technique, the copy constructor and assignment operators still reference the old object and hence are very fast. An actual copy is made only when a write is performed, that is, if the object is about to be changed. The net result is excellent performance, but with easy-to-understand copy semantics.

A separate Tools.h++ class RWCSubString supports substring extraction and modification operations.

Persistence

Simple

Example

Oracle treats multibyte and single byte strings differently. If aDB represents an Oracle database and the proper character set is loaded on the machine, the output is:

Sybase does not differentiate multibyte and single byte strings. If aDB represents a Sybase database and the proper character set is loaded on the machine, the output is:

Public Constructors

RWDBMBString();
RWDBMBString(const char* cs);
RWDBMBString(const char* cs, size_t N);
RWDBMBString(RWSize_T ic);
RWDBMBString(const RWDBMBString& str);
RWDBMBString(const RWCString& str);
RWDBMBString(const RWCSubString& ss);
RWDBMBString(char c);
RWDBMBString(char c, size_t N);

Assignment Operators

RWDBMBString&
operator=(const char* cs);
RWDBMBString&
operator=(const RWCString& str);
RWDBMBString&
operator=(const RWDBMBString& str);


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.