SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWDBMBString Class Reference

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>

Inheritance diagram for RWDBMBString:
RWCString

Public Member Functions

 RWDBMBString ()
 
 RWDBMBString (char c)
 
 RWDBMBString (char c, size_t N)
 
 RWDBMBString (const char *a)
 
 RWDBMBString (const char *a, size_t N)
 
 RWDBMBString (const RWCString &S)
 
 RWDBMBString (const RWCSubString &SS)
 
 RWDBMBString (const RWDBMBString &str)
 
 RWDBMBString (RWSize_T ic)
 
 RWDBMBString (signed char c)
 
 RWDBMBString (unsigned char c)
 
RWDBMBStringoperator= (const char *cs)
 
RWDBMBStringoperator= (const RWCString &str)
 
RWDBMBStringoperator= (const RWDBMBString &str)
 
- Public Member Functions inherited from RWCString
 RWCString ()
 
 RWCString (char c)
 
 RWCString (char c, size_t count)
 
 RWCString (const char *str)
 
 RWCString (const char *str, size_t len)
 
 RWCString (const ConstSubString &str)
 
 RWCString (const RWCString &str)
 
 RWCString (const std::string &str)
 
 RWCString (const SubString &str)
 
 RWCString (RWCString &&str)
 
 RWCString (RWSize_T cap)
 
 RWCString (signed char c)
 
 RWCString (unsigned char c)
 
RWCStringappend (char c, size_t count=1)
 
RWCStringappend (const char *str)
 
RWCStringappend (const char *str, size_t len)
 
RWCStringappend (const ConstSubString &str)
 
RWCStringappend (const RWCString &str)
 
RWCStringappend (const RWCString &str, size_t len)
 
RWCStringappend (const std::string &str)
 
RWCStringappend (const std::string &str, size_t len)
 
RWCStringappend (const SubString &str)
 
RWCStringassign (char c, size_t count=1)
 
RWCStringassign (const char *str)
 
RWCStringassign (const char *str, size_t len)
 
RWCStringassign (const ConstSubString &str)
 
RWCStringassign (const RWCString &str)
 
RWCStringassign (const std::string &str)
 
RWCStringassign (const SubString &str)
 
RWspace binaryStoreSize () const
 
size_t capacity () const
 
size_t capacity (size_t cap)
 
int collate (const char *str) const
 
int collate (const RWCString &str) const
 
int collate (const std::string &str) const
 
int compareTo (const char *str, caseCompare cmp=exact) const
 
int compareTo (const char *str, size_t len, caseCompare cmp=exact) const
 
int compareTo (const ConstSubString &str, caseCompare cmp=exact) const
 
int compareTo (const RWCString &str, caseCompare cmp=exact) const
 
int compareTo (const RWCString *str, caseCompare cmp=exact) const
 
int compareTo (const std::string &str, caseCompare cmp=exact) const
 
int compareTo (const std::string *str, caseCompare cmp=exact) const
 
int compareTo (const SubString &str, caseCompare cmp=exact) const
 
bool contains (const char *str, caseCompare cmp=exact) const
 
bool contains (const char *str, size_t len, caseCompare cmp=exact) const
 
bool contains (const ConstSubString &str, caseCompare cmp=exact) const
 
bool contains (const RWCString &str, caseCompare cmp=exact) const
 
bool contains (const std::string &str, caseCompare cmp=exact) const
 
bool contains (const SubString &str, caseCompare cmp=exact) const
 
const char * data () const
 
size_t first (char c) const
 
size_t first (char c, size_t) const
 
size_t first (const char *str) const
 
size_t first (const char *str, size_t len) const
 
size_t firstNotOf (char c, size_t pos=0) const
 
size_t firstNotOf (const char *str, size_t pos, size_t len) const
 
size_t firstNotOf (const char *str, size_t pos=0) const
 
size_t firstNotOf (const ConstSubString &str, size_t pos=0) const
 
size_t firstNotOf (const RWCString &str, size_t pos=0) const
 
size_t firstNotOf (const std::string &str, size_t pos=0) const
 
size_t firstNotOf (const SubString &str, size_t pos=0) const
 
size_t firstOf (char c, size_t pos=0) const
 
size_t firstOf (const char *str, size_t pos, size_t len) const
 
size_t firstOf (const char *str, size_t pos=0) const
 
size_t firstOf (const ConstSubString &str, size_t pos=0) const
 
size_t firstOf (const RWCString &str, size_t pos=0) const
 
size_t firstOf (const std::string &str, size_t pos=0) const
 
size_t firstOf (const SubString &str, size_t pos=0) const
 
unsigned hash (caseCompare cmp=exact) const
 
size_t index (const char *pat, size_t patlen, size_t start, caseCompare cmp) const
 
size_t index (const char *pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const char *re, size_t *ext, size_t start=0) const
 
size_t index (const char pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const ConstSubString &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const RWCRegexp &re, size_t *ext, size_t start=0) const
 
size_t index (const RWCRegexp &re, size_t start=0) const
 
size_t index (const RWCRExpr &re, size_t *ext, size_t start=0) const
 
size_t index (const RWCRExpr &re, size_t start=0) const
 
size_t index (const RWCString &pat, size_t patlen, size_t start, caseCompare cmp) const
 
size_t index (const RWCString &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const std::string &pat, size_t patlen, size_t start, caseCompare cmp) const
 
size_t index (const std::string &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const SubString &pat, size_t start=0, caseCompare cmp=exact) const
 
RWCStringinsert (size_t pos, char c, size_t count)
 
RWCStringinsert (size_t pos, const char *str)
 
RWCStringinsert (size_t pos, const char *str, size_t len)
 
RWCStringinsert (size_t pos, const ConstSubString &str)
 
RWCStringinsert (size_t pos, const RWCString &str)
 
RWCStringinsert (size_t pos, const RWCString &str, size_t len)
 
RWCStringinsert (size_t pos, const std::string &str)
 
RWCStringinsert (size_t pos, const std::string &str, size_t len)
 
RWCStringinsert (size_t pos, const SubString &str)
 
bool isAscii () const
 
bool isNull () const
 
size_t last (char c) const
 
size_t last (char c, size_t) const
 
size_t last (const char *str) const
 
size_t last (const char *str, size_t len) const
 
size_t lastNotOf (char c, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const char *str, size_t pos, size_t len) const
 
size_t lastNotOf (const char *str, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const ConstSubString &str, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const RWCString &str, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const std::string &str, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const SubString &str, size_t pos=RW_NPOS) const
 
size_t lastOf (char c, size_t pos=RW_NPOS) const
 
size_t lastOf (const char *str, size_t pos, size_t len) const
 
size_t lastOf (const char *str, size_t pos=RW_NPOS) const
 
size_t lastOf (const ConstSubString &str, size_t pos=RW_NPOS) const
 
size_t lastOf (const RWCString &str, size_t pos=RW_NPOS) const
 
size_t lastOf (const std::string &str, size_t pos=RW_NPOS) const
 
size_t lastOf (const SubString &str, size_t pos=RW_NPOS) const
 
size_t length () const
 
ConstSubString match (const RWCRExpr &) const
 
SubString match (const RWCRExpr &re)
 
SubString match (const RWCRExpr &re, size_t start)
 
ConstSubString match (const RWCRExpr &re, size_t start) const
 
size_t mbLength () const
 
 operator const char * () const
 
SubString operator() (const RWCRegexp &re)
 
ConstSubString operator() (const RWCRegexp &re) const
 
SubString operator() (const RWCRegexp &re, size_t start)
 
ConstSubString operator() (const RWCRegexp &re, size_t start) const
 
char & operator() (size_t i)
 
char operator() (size_t i) const
 
SubString operator() (size_t start, size_t len)
 
ConstSubString operator() (size_t start, size_t len) const
 
RWCStringoperator+= (char c)
 
RWCStringoperator+= (const char *str)
 
RWCStringoperator+= (const ConstSubString &str)
 
RWCStringoperator+= (const RWCString &str)
 
RWCStringoperator+= (const std::string &str)
 
RWCStringoperator+= (const SubString &str)
 
RWCStringoperator= (char c)
 
RWCStringoperator= (const char *str)
 
RWCStringoperator= (const ConstSubString &str)
 
RWCStringoperator= (const RWCString &str)
 
RWCStringoperator= (const std::string &str)
 
RWCStringoperator= (const SubString &str)
 
RWCStringoperator= (RWCString &&str)
 
char & operator[] (char i)
 
char operator[] (char i) const
 
char & operator[] (int i)
 
char operator[] (int i) const
 
char & operator[] (long i)
 
char operator[] (long i) const
 
char & operator[] (long long i)
 
char operator[] (long long i) const
 
char & operator[] (short i)
 
char operator[] (short i) const
 
char & operator[] (signed char i)
 
char operator[] (signed char i) const
 
char & operator[] (unsigned char i)
 
char operator[] (unsigned char i) const
 
char & operator[] (unsigned int i)
 
char operator[] (unsigned int i) const
 
char & operator[] (unsigned long i)
 
char operator[] (unsigned long i) const
 
char & operator[] (unsigned long long i)
 
char operator[] (unsigned long long i) const
 
char & operator[] (unsigned short i)
 
char operator[] (unsigned short i) const
 
RWCStringprepend (char c, size_t count=1)
 
RWCStringprepend (const char *str)
 
RWCStringprepend (const char *str, size_t len)
 
RWCStringprepend (const ConstSubString &str)
 
RWCStringprepend (const RWCString &str)
 
RWCStringprepend (const RWCString &str, size_t len)
 
RWCStringprepend (const std::string &str)
 
RWCStringprepend (const std::string &str, size_t len)
 
RWCStringprepend (const SubString &str)
 
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, char delim='\n')
 
std::istream & readToken (std::istream &strm)
 
RWCStringremove (size_t pos)
 
RWCStringremove (size_t pos, size_t len)
 
RWCStringreplace (const RWCRExpr &re, const char *str, scopeType scope=one)
 
RWCStringreplace (const RWCRExpr &re, const RWCString &str, scopeType scope=one)
 
RWCStringreplace (size_t pos, size_t len, const char *str)
 
RWCStringreplace (size_t pos, size_t len, const char *str, size_t strLen)
 
RWCStringreplace (size_t pos, size_t len, const ConstSubString &str)
 
RWCStringreplace (size_t pos, size_t len, const RWCString &str)
 
RWCStringreplace (size_t pos, size_t len, const RWCString &str, size_t strLen)
 
RWCStringreplace (size_t pos, size_t len, const std::string &str)
 
RWCStringreplace (size_t pos, size_t len, const std::string &str, size_t strLen)
 
RWCStringreplace (size_t pos, size_t len, const SubString &str)
 
void resize (size_t len)
 
size_t rindex (const char *pat, caseCompare cmp) const
 
size_t rindex (const char *pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const char *pat, size_t patlen, size_t end, caseCompare cmp) const
 
size_t rindex (const char pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const ConstSubString &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const RWCString &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const RWCString &pat, size_t patlen, size_t end, caseCompare cmp) const
 
size_t rindex (const std::string &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const std::string &pat, size_t patlen, size_t end, caseCompare cmp) const
 
size_t rindex (const SubString &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
void shrink ()
 
std::string & std ()
 
const std::string & std () const
 
SubString strip (stripType st=trailing, char c=' ')
 
ConstSubString strip (stripType st=trailing, char c=' ') const
 
SubString subString (const char *pat, size_t start=0, caseCompare cmp=exact)
 
ConstSubString subString (const char *pat, size_t start=0, caseCompare cmp=exact) const
 
void swap (RWCString &str)
 
void toLower ()
 
void toUpper ()
 

Additional Inherited Members

- Public Types inherited from RWCString
enum  caseCompare { exact , ignoreCase , ignoreCaseStrict }
 
typedef RWCConstSubString ConstSubString
 
enum  scopeType { one , all }
 
enum  stripType { leading , trailing , both }
 
typedef RWCSubString SubString
 
- Static Public Member Functions inherited from RWCString
static size_t byteCount (const char *str, size_t nChars=RW_NPOS)
 
static unsigned hash (const RWCString &str)
 
static size_t mbLength (const char *str, size_t nBytes=RW_NPOS)
 

Detailed Description

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.

Synopsis
#include <rw/db/mbstring.h>
Represents a multibyte character string, ensuring that these get handled correctly by databases that ...
Definition mbstring.h:87
Persistence
Simple
Example
#include <rw/db/mbstring.h>
#include <iostream.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;
}
Manages connections with database servers.
Definition dbase.h:91
RWDBTable table(const RWCString &name) const
Encapsulates an SQL INSERT statement.
Definition inserter.h:177
RWCString asString() const
Definition inserter.h:247
RWDBInserter inserter(size_t cache=0) const

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>')

Constructor & Destructor Documentation

◆ RWDBMBString() [1/11]

RWDBMBString::RWDBMBString ( )
inline

Calls the corresponding constructor of RWCString.

◆ RWDBMBString() [2/11]

RWDBMBString::RWDBMBString ( RWSize_T ic)
inline

Calls the corresponding constructor of RWCString.

◆ RWDBMBString() [3/11]

RWDBMBString::RWDBMBString ( const RWCString & S)
inline

Calls the corresponding constructor of RWCString.

◆ RWDBMBString() [4/11]

RWDBMBString::RWDBMBString ( const RWDBMBString & str)
inline

Copy constructor. The created string copies str's data.

◆ RWDBMBString() [5/11]

RWDBMBString::RWDBMBString ( const char * a)
inline

Calls the corresponding constructor of RWCString.

◆ RWDBMBString() [6/11]

RWDBMBString::RWDBMBString ( const char * a,
size_t N )
inline

Calls the corresponding constructor of RWCString.

◆ RWDBMBString() [7/11]

RWDBMBString::RWDBMBString ( char c)
inline

Calls the corresponding constructor of RWCString.

◆ RWDBMBString() [8/11]

RWDBMBString::RWDBMBString ( char c,
size_t N )
inline

Calls the corresponding constructor of RWCString.

◆ RWDBMBString() [9/11]

RWDBMBString::RWDBMBString ( const RWCSubString & SS)
inline

Calls the corresponding constructor of RWCString.

◆ RWDBMBString() [10/11]

RWDBMBString::RWDBMBString ( unsigned char c)
inline

Calls the corresponding constructor of RWCString.

◆ RWDBMBString() [11/11]

RWDBMBString::RWDBMBString ( signed char c)
inline

Calls the corresponding constructor of RWCString.

Member Function Documentation

◆ operator=() [1/3]

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.

◆ operator=() [2/3]

RWDBMBString & RWDBMBString::operator= ( const RWCString & str)
inline

The string copies str's data. Returns a reference to self.

◆ operator=() [3/3]

RWDBMBString & RWDBMBString::operator= ( const RWDBMBString & str)
inline

The string copies str's data. Returns a reference to self.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.