Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals | Related Pages

CDBstring Class Reference

The CDB abstract string class. More...

#include <cdbstring.h>

Inheritance diagram for CDBstring:

CDBcharacterVector

Public Types

typedef const CDBcharacterIterator const_iterator
 Forward to CDBcharacterVector's constant iterator type.
typedef CDBcharacterIterator iterator
 Forward to CDBcharacterVector's iterator type.

Public Member Functions

char at (size_t pos) const
 Receive one character from string (read).
char & at (size_t pos)
 Receive one character from string (read/write).
const char * c_str () const
 Reive C-string like literal.
 CDBstring (const UnicodeString &ic)
 CDBstring (const std::wstring &stl)
 CDBstring (const std::string &stl)
 CDBstring (const UChar *sup)
 CDBstring (const wchar_t *sup)
 CDBstring (const CDBstring &ref)
 Copy constructor.
 CDBstring (const char *p=0)
 The constructor for Mchar* string literals.
int fromUtf8 (const char *src)
 operator std::string ()
 operator std::wstring ()
 operator UnicodeString ()
bool operator!= (const CDBstring &s1)
CDBstring operator+ (const char &c) const
CDBstring operator+ (const CDBstring &ref) const
CDBstringoperator+= (const char &c)
CDBstringoperator+= (const CDBstring &ref)
CDBstringoperator= (const CDBstring &ref)
bool operator== (const CDBstring &s1)
char operator[] (size_t pos) const
char & operator[] (size_t pos)
void optimize ()
const char * strstr (const CDBstring &search)
CDBstring substr (int istart, int ifor) const
 Extract part of string (integer version).
CDBstring substr (const iterator &istart, const iterator &iend) const
 Extract part of string.
int toAscii (char *dst, int dst_size) const
int toIcu (UChar *dst, int dst_size) const
int toUtf8 (char *dst, int dst_size) const
int toWchar (wchar_t *dst, int dst_size) const

Detailed Description

The CDB abstract string class.

This class is defined to handle string literals. It is based on transcoder implementation of string_forward.h. For dynamic memory allocation the code of CDBcharacterVector is used. CDBstring is variant to other string literal classes. You can convert std::string, std::wstring and UnicodeString from and to CDBstring.

Date:
26.07.2005
Author:
Joerg Hundertmarck, <joerg@hirnfrei.org>


Member Typedef Documentation

typedef const CDBcharacterIterator const_iterator
 

Forward to CDBcharacterVector's constant iterator type.

typedef CDBcharacterIterator iterator
 

Forward to CDBcharacterVector's iterator type.


Constructor & Destructor Documentation

CDBstring const char *  p = 0  ) 
 

The constructor for Mchar* string literals.

CDBstring const CDBstring ref  ) 
 

Copy constructor.

CDBstring const wchar_t *  sup  ) 
 

CDBstring const UChar *  sup  ) 
 

CDBstring const std::string &  stl  ) 
 

CDBstring const std::wstring &  stl  ) 
 

CDBstring const UnicodeString &  ic  ) 
 


Member Function Documentation

char at size_t  pos  )  const
 

Receive one character from string (read).

char& at size_t  pos  ) 
 

Receive one character from string (read/write).

const char* c_str  )  const
 

Reive C-string like literal.

Receive pointer to a vector of Mchar characters.

Returns:
Pointer to a vector of Mchar's.

int fromUtf8 const char *  src  ) 
 

operator std::string  ) 
 

operator std::wstring  ) 
 

operator UnicodeString  ) 
 

bool operator!= const CDBstring s1  ) 
 

CDBstring operator+ const char &  c  )  const
 

CDBstring operator+ const CDBstring ref  )  const
 

CDBstring& operator+= const char &  c  ) 
 

CDBstring& operator+= const CDBstring ref  ) 
 

CDBstring& operator= const CDBstring ref  )  [inline]
 

bool operator== const CDBstring s1  ) 
 

char operator[] size_t  pos  )  const [inline]
 

char& operator[] size_t  pos  )  [inline]
 

void optimize  ) 
 

const char* strstr const CDBstring search  ) 
 

CDBstring substr int  istart,
int  ifor
const
 

Extract part of string (integer version).

This method extracts a part of the corresponding string. It's behavoir is like substring(const iterator &, const iterator &).

Parameters:
istart The position of the start character represented by integer.
ifor Length of the part.
Returns:
Copy of extracted content

CDBstring substr const iterator istart,
const iterator iend
const
 

Extract part of string.

This method extracts a part of the corresponding string.

Parameters:
istart The position of the start character represented by iterator.
iend The position of the end character represented by iterator.
Returns:
Copy of extracted content

int toAscii char *  dst,
int  dst_size
const
 

int toIcu UChar *  dst,
int  dst_size
const
 

int toUtf8 char *  dst,
int  dst_size
const
 

int toWchar wchar_t *  dst,
int  dst_size
const
 


Generated on Mon Feb 6 00:30:32 2006 for CDB by  doxygen 1.4.4