A class to convert strings between UCS-4 and local encodings.
More...
#include <scim_iconv.h>
Public Member Functions |
| IConvert (const String &encoding=String()) |
| Constructor.
|
| IConvert (const IConvert &iconvert) |
| Copy constructor.
|
| ~IConvert () |
const IConvert & | operator= (const IConvert &iconvert) |
| Assign operator.
|
bool | set_encoding (const String &encoding) |
| Set the working local encoding.
|
String | get_encoding () const |
| Get the current working local encoding.
|
bool | convert (String &dest, const WideString &src) const |
| Convert a UCS-4 encoded WideString into a local encoded String.
|
bool | convert (String &dest, const ucs4_t *src, int src_len) const |
| Convert a UCS-4 encoded WideString into a local encoded String.
|
bool | convert (WideString &dest, const String &src) const |
| Convert a local encoded String into a UCS-4 encoded WideString.
|
bool | convert (WideString &dest, const char *src, int src_len) const |
| Convert a local encoded String into a UCS-4 encoded WideString.
|
bool | test_convert (const WideString &src) const |
| Test if a UCS-4 encoded WideString can be converted to a local encoded String.
|
bool | test_convert (const ucs4_t *src, int src_len) const |
| Test if a ucs-4 encoded string can be converted to a local encoded String.
|
bool | test_convert (const String &src) const |
| Test if a local encoded string can be converted to a UCS-4 encoded WideString.
|
bool | test_convert (const char *src, int src_len) const |
| Test if a local encoded string can be converted to a UCS-4 encoded WideString.
|
Detailed Description
A class to convert strings between UCS-4 and local encodings.
Constructor & Destructor Documentation
scim::IConvert::IConvert |
( |
const String & |
encoding = String() | ) |
|
Constructor.
- Parameters
-
encoding | the local encoding to be used. |
scim::IConvert::IConvert |
( |
const IConvert & |
iconvert | ) |
|
scim::IConvert::~IConvert |
( |
| ) |
|
Member Function Documentation
bool scim::IConvert::set_encoding |
( |
const String & |
encoding | ) |
|
Set the working local encoding.
- Parameters
-
encoding | the local encoding to be used. |
- Returns
- whether the encoding is ok or not.
String scim::IConvert::get_encoding |
( |
| ) |
const |
Get the current working local encoding.
- Returns
- The name of the local encoding, like "UTF-8", "GB2312" etc.
Convert a UCS-4 encoded WideString into a local encoded String.
- Parameters
-
dest | the result string will be stored here. |
src | the WideString to be converted. |
- Returns
- true if success.
bool scim::IConvert::convert |
( |
String & |
dest, |
|
|
const ucs4_t * |
src, |
|
|
int |
src_len |
|
) |
| const |
Convert a UCS-4 encoded WideString into a local encoded String.
- Parameters
-
dest | the result string will be stored here. |
src | the ucs-4 encoded string to be converted. |
src_len | the length of source string. |
- Returns
- true if success.
Convert a local encoded String into a UCS-4 encoded WideString.
- Parameters
-
dest | the result string will be stored here. |
src | the local encoded string to be converted. |
- Returns
- ture if success.
bool scim::IConvert::convert |
( |
WideString & |
dest, |
|
|
const char * |
src, |
|
|
int |
src_len |
|
) |
| const |
Convert a local encoded String into a UCS-4 encoded WideString.
- Parameters
-
dest | the result string will be stored here. |
src | the local encoded string to be converted. |
src_len | the length of source string. |
- Returns
- ture if success.
bool scim::IConvert::test_convert |
( |
const WideString & |
src | ) |
const |
Test if a UCS-4 encoded WideString can be converted to a local encoded String.
- Parameters
-
src | the ucs-4 encoded string to be test. |
- Returns
- true if it can be converted without any problem.
bool scim::IConvert::test_convert |
( |
const ucs4_t * |
src, |
|
|
int |
src_len |
|
) |
| const |
Test if a ucs-4 encoded string can be converted to a local encoded String.
- Parameters
-
src | the ucs-4 encoded string to be test. |
src_len | the length of source string. |
- Returns
- true if it can be converted without any problem.
bool scim::IConvert::test_convert |
( |
const String & |
src | ) |
const |
Test if a local encoded string can be converted to a UCS-4 encoded WideString.
- Parameters
-
src | the local encoded string to be test. |
- Returns
- true if it can be converted without any problem.
bool scim::IConvert::test_convert |
( |
const char * |
src, |
|
|
int |
src_len |
|
) |
| const |
Test if a local encoded string can be converted to a UCS-4 encoded WideString.
- Parameters
-
src | the local encoded string to be test. |
src_len | the length of source string. |
- Returns
- true if it can be converted without any problem.
The documentation for this class was generated from the following file: