#include <IConv.hpp>
Public Member Functions | |
| IConv_t () | |
| Create an IConv object. | |
| IConv_t (const String &fromEncoding, const String &toEncoding) | |
| Create an IConv object and initializes its handle to convert between the specified character encodings. | |
| ~IConv_t () | |
| Frees all resources and destroys the object. | |
| bool | open (const String &fromEncoding, const String &toEncoding) |
| Initializes the IConv object handle to convert between the specified character encodings. | |
| size_t | convert (char **istr, size_t *ibytesleft, char **ostr, size_t *obytesleft) |
| Converts the text in the input buffer and stores the result text in the output buffer. | |
| bool | close () |
| Frees all object resources. | |
Private Attributes | |
| iconv_t | m_iconv |
See also the IConv namespace for some utility functions.
Definition at line 51 of file IConv.hpp.
| BLOCXX_NAMESPACE::IConv_t::IConv_t | ( | ) |
Create an IConv object and initializes its handle to convert between the specified character encodings.
Throws an error if the requested conversion is not available.
| fromEncoding | source encoding name | |
| toEncoding | destination encoding name |
| StringConversionException | if the conversion is not supported. |
Definition at line 57 of file IConv.cpp.
References BLOCXX_THROW, BLOCXX_NAMESPACE::String::c_str(), and m_iconv.
| BLOCXX_NAMESPACE::IConv_t::~IConv_t | ( | ) |
Initializes the IConv object handle to convert between the specified character encodings.
See "man 3 iconv_open" for more detailed description.
| fromEncoding | source encoding name | |
| toEncoding | destination encoding name |
Definition at line 78 of file IConv.cpp.
References BLOCXX_NAMESPACE::String::c_str(), close(), and m_iconv.
| size_t BLOCXX_NAMESPACE::IConv_t::convert | ( | char ** | istr, | |
| size_t * | ibytesleft, | |||
| char ** | ostr, | |||
| size_t * | obytesleft | |||
| ) |
Converts the text in the input buffer and stores the result text in the output buffer.
See "man 3 iconv" for more detailed description.
| istr | pointer to input text buffer | |
| ibytesleft | number of bytes in ibuf | |
| ostr | pointer to output text buffer | |
| obytesleft | number of bytes in obuf |
Definition at line 88 of file IConv.cpp.
References BLOCXX_ASSERT, and m_iconv.
Referenced by BLOCXX_NAMESPACE::IConv::fromByteString(), BLOCXX_NAMESPACE::IConv::fromWideString(), BLOCXX_NAMESPACE::IConv::toByteString(), and BLOCXX_NAMESPACE::IConv::toWideString().
| bool BLOCXX_NAMESPACE::IConv_t::close | ( | ) |
Frees all object resources.
See "man 3 iconv_close" for more detailed description.
Definition at line 105 of file IConv.cpp.
References m_iconv.
Referenced by open(), and ~IConv_t().
iconv_t BLOCXX_NAMESPACE::IConv_t::m_iconv [private] |
1.5.6