Back to index

im-sdk  12.3.91
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
u16string Class Reference

#include <basictype.hh>

Inheritance diagram for u16string:
Inheritance graph
[legend]
Collaboration diagram for u16string:
Collaboration graph
[legend]

List of all members.

Public Types

typedef BaseClass::iterator iterator
typedef BaseClass::const_iterator const_iterator
typedef BaseClass::reverse_iterator reverse_iterator
typedef
BaseClass::const_reverse_iterator 
const_reverse_iterator

Public Member Functions

int compare (const u16string &s) const
size_type find (UTFCHAR c, size_type pos=0) const
size_type find (const u16string &s, size_type pos=0) const
u16string substr (size_type pos=0, size_type n=npos) const
const char * get_charstr () const
const std::string * get_string () const
 u16string ()
 u16string (UTFCHAR *str)
 u16string (UTFCHAR *str, size_type n)
 u16string (const u16string &str, size_type pos, size_type n)
 u16string (const char *cstr)
 u16string (const std::string &s)

Private Types

enum  CHARSTR_STATE { UNINIT, VALID, INVALID }
typedef std::basic_string
< UTFCHAR, UTFCHAR_char_traits
BaseClass

Private Member Functions

void set_charstr ()

Private Attributes

enum u16string::CHARSTR_STATE state
std::string charstr

Detailed Description

Definition at line 130 of file basictype.hh.


Member Typedef Documentation

typedef std::basic_string<UTFCHAR, UTFCHAR_char_traits> u16string::BaseClass [private]

Definition at line 132 of file basictype.hh.

typedef BaseClass::const_iterator u16string::const_iterator

Definition at line 159 of file basictype.hh.

typedef BaseClass::const_reverse_iterator u16string::const_reverse_iterator

Definition at line 161 of file basictype.hh.

typedef BaseClass::iterator u16string::iterator

Definition at line 158 of file basictype.hh.

typedef BaseClass::reverse_iterator u16string::reverse_iterator

Definition at line 160 of file basictype.hh.


Member Enumeration Documentation

enum u16string::CHARSTR_STATE [private]
Enumerator:
UNINIT 
VALID 
INVALID 

Definition at line 133 of file basictype.hh.


Constructor & Destructor Documentation

u16string::u16string ( ) [inline]

Definition at line 194 of file basictype.hh.

                : BaseClass()
    {
       charstr = "";
       state = VALID;
    }

Here is the caller graph for this function:

u16string::u16string ( UTFCHAR str) [inline]

Definition at line 199 of file basictype.hh.

                            : BaseClass(str)
    {
       set_charstr();
    }

Here is the call graph for this function:

u16string::u16string ( UTFCHAR str,
size_type  n 
) [inline]

Definition at line 203 of file basictype.hh.

                                         : BaseClass(str, n)
    {
       set_charstr();
    }

Here is the call graph for this function:

u16string::u16string ( const u16string str,
size_type  pos,
size_type  n 
) [inline]

Definition at line 207 of file basictype.hh.

       : BaseClass(str, pos, n)
    {
       set_charstr();
    }

Here is the call graph for this function:

u16string::u16string ( const char *  cstr) [inline]

Definition at line 213 of file basictype.hh.

       : BaseClass(strlen(cstr), 0)
    {
       const char *p;
       BaseClass::iterator it = begin();
       charstr = cstr;
       state = VALID;
       for (p = cstr; *p; p++, it++) {
           *it = *p;
       }
    }
u16string::u16string ( const std::string &  s) [inline]

Definition at line 224 of file basictype.hh.

       : BaseClass(s.size(), 0)
    {
       int i;
       int n = s.size();
       BaseClass::iterator it = begin();
       std::string::const_iterator its = s.begin();
       charstr = s;
       state = VALID;
       for (i = 0; i < n; i++, it++, its++) {
           *it = (UTFCHAR) *its;
       }
    }

Member Function Documentation

int u16string::compare ( const u16string s) const [inline]

Definition at line 171 of file basictype.hh.

    { return this->BaseClass::compare(s); }

Here is the caller graph for this function:

size_type u16string::find ( UTFCHAR  c,
size_type  pos = 0 
) const [inline]

Definition at line 173 of file basictype.hh.

    { return this->BaseClass::find(c, pos); }

Here is the caller graph for this function:

size_type u16string::find ( const u16string s,
size_type  pos = 0 
) const [inline]

Definition at line 175 of file basictype.hh.

    { return this->BaseClass::find(s, pos); }

Here is the call graph for this function:

const char* u16string::get_charstr ( ) const [inline]

Definition at line 184 of file basictype.hh.

    {
       if (state != VALID) return NULL;
       return charstr.c_str();
    }

Here is the caller graph for this function:

const std::string* u16string::get_string ( ) const [inline]

Definition at line 189 of file basictype.hh.

    {
       if (state != VALID) return NULL;
       return &charstr;
    }

Here is the caller graph for this function:

void u16string::set_charstr ( ) [inline, private]

Definition at line 139 of file basictype.hh.

    {
       size_type size = BaseClass::size();
       charstr = std::string(size, 0);
       BaseClass::iterator it_s = begin();
       std::string::iterator it_d = charstr.begin();
       for (; it_s != end(); it_s++, it_d++) {
           if (*it_s > 0x7F) {
              state = INVALID;
              return;
           }
           *it_d = (char) *it_s;
       }
       state = VALID;
       return;
    }

Here is the caller graph for this function:

u16string u16string::substr ( size_type  pos = 0,
size_type  n = npos 
) const [inline]

Definition at line 178 of file basictype.hh.

    { return u16string(*this, pos, n); }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

std::string u16string::charstr [private]

Definition at line 138 of file basictype.hh.


The documentation for this class was generated from the following file: