#include <CharsetConverter.h++>
Public Member Functions | |
| CharsetConverter (const char *fromCode, const char *toCode) | |
| Construct a new CharsetConverter for converting characters from one encoding to another. | |
| ~CharsetConverter () | |
| Destructor. | |
| bool | isValid () const throw () |
| Determine if the conversion specified in the constructor is valid. | |
| size_t | convert (const byte_t **inBuf, size_t *inBytesLeft, byte_t **outBuf, size_t *outBytesLeft) throw () |
| Convert bytes of data from the source encoding to the target encoding. | |
| void | reset () throw () |
| Reset the encoder. | |
This class is simply a thin wrapper around the libiconv character set conversion library.
| CharsetConverter | ( | const char * | fromCode, | |
| const char * | toCode | |||
| ) |
Construct a new CharsetConverter for converting characters from one encoding to another.
After the object is constructed, a call should be made to isValid() to determine if the conversion is valid. See the libiconv documentation for a list of supported encodings.
| fromCode | The source encoding. | |
| toCode | The target encoding. |
| ~CharsetConverter | ( | ) |
Destructor.
| size_t convert | ( | const byte_t ** | inBuf, | |
| size_t * | inBytesLeft, | |||
| byte_t ** | outBuf, | |||
| size_t * | outBytesLeft | |||
| ) | throw () |
Convert bytes of data from the source encoding to the target encoding.
This method may be called repeatedly to convert a large amount of text one block at a time; the shift state is preserved between calls. To begin converting a new
| inBuf | The input buffer. | |
| inBytesLeft | The number of input bytes remaining. | |
| outBuf | The output buffer. | |
| outBytesLeft | The number of output bytes remaining. |
(size_t)-1 on failure; see iconv(3) for details. | bool isValid | ( | ) | const throw () [inline] |
Determine if the conversion specified in the constructor is valid.
| void reset | ( | ) | throw () |
Reset the encoder.
Sets the conversion state to the initial state.
1.5.9