SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Represents a multibyte character string, ensuring that these get handled correctly by databases that differentiate between multibyte and single byte character strings. More...
#include <rw/db/mbstring.h>
Public Member Functions | |
RWDBMBString () | |
RWDBMBString (RWSize_T ic) | |
RWDBMBString (const RWCString &S) | |
RWDBMBString (const RWDBMBString &str) | |
RWDBMBString (const char *a) | |
RWDBMBString (const char *a, size_t N) | |
RWDBMBString (char c) | |
RWDBMBString (char c, size_t N) | |
RWDBMBString (const RWCSubString &SS) | |
RWDBMBString (unsigned char c) | |
RWDBMBString (signed char c) | |
RWDBMBString & | operator= (const char *cs) |
RWDBMBString & | operator= (const RWCString &str) |
RWDBMBString & | operator= (const RWDBMBString &str) |
Some databases require different handling of single byte character sets (SBCS), like US-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 the DB Interface Module to make the critical differentiation.
RWDBMBString derives publicly from RWCString, such that all the facilities and functions of RWCString are available. For a complete description of those functions, see the Essential Tools Module documentation for class RWCString.
We recommend that you do not derive from RWDBMBString.
#include <rw/db/mbstring.h> RWDBMBString a;
Simple
#include <iostream.h> #include <rw/db/mbstring.h> void outputTest(RWDBDatabase& aDB){ RWDBInserter ins = aDB.table("t1").inserter(); RWDBMBString mbstring("\x4E\x16\x75\x4C\x60\xA8\x59\x7D"); ins << mbstring; cout << ins.asString() << endl; }
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:
INSERT INTO T1 VALUES (N'<U+4E16><U+754C><U+60A8><U+597D>')
Sybase does not differentiate between multibyte and single byte strings. If aDB
represents a Sybase database and the proper character set is loaded on the machine, the output is:
INSERT INTO T1 VALUES ('<U+4E16><U+754C><U+60A8><U+597D>')
RWDBMBString::RWDBMBString | ( | ) | [inline] |
Calls the corresponding constructor of RWCString.
RWDBMBString::RWDBMBString | ( | RWSize_T | ic | ) | [inline] |
Calls the corresponding constructor of RWCString.
RWDBMBString::RWDBMBString | ( | const RWCString & | S | ) | [inline] |
Calls the corresponding constructor of RWCString.
RWDBMBString::RWDBMBString | ( | const RWDBMBString & | str | ) | [inline] |
Copy constructor. The created string copies str's data.
RWDBMBString::RWDBMBString | ( | const char * | a | ) | [inline] |
Calls the corresponding constructor of RWCString.
RWDBMBString::RWDBMBString | ( | const char * | a, | |
size_t | N | |||
) | [inline] |
Calls the corresponding constructor of RWCString.
RWDBMBString::RWDBMBString | ( | char | c | ) | [inline] |
Calls the corresponding constructor of RWCString.
RWDBMBString::RWDBMBString | ( | char | c, | |
size_t | N | |||
) | [inline] |
Calls the corresponding constructor of RWCString.
RWDBMBString::RWDBMBString | ( | const RWCSubString & | SS | ) | [inline] |
Calls the corresponding constructor of RWCString.
RWDBMBString::RWDBMBString | ( | unsigned char | c | ) | [inline] |
Calls the corresponding constructor of RWCString.
RWDBMBString::RWDBMBString | ( | signed char | c | ) | [inline] |
Calls the corresponding constructor of RWCString.
RWDBMBString& RWDBMBString::operator= | ( | const RWDBMBString & | str | ) | [inline] |
The string copies str's data. Returns a reference to self.
RWDBMBString& RWDBMBString::operator= | ( | const RWCString & | str | ) | [inline] |
The string copies str's data. Returns a reference to self.
Reimplemented from RWCString.
RWDBMBString& RWDBMBString::operator= | ( | const char * | cs | ) | [inline] |
Copies the null-terminated character string pointed to by cs into self. Returns a reference to self. This function is incompatible with cs strings with embedded nulls. This function may be incompatible with cs MBCS strings.
Reimplemented from RWCString.
© 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.