#include <TextConverter.h>
Public Types | |
typedef int(* | Transform )(int) |
Public Member Functions | |
int | convert (const void *source, int length, std::string &destination) |
int | convert (const std::string &source, std::string &destination) |
int | convert (const void *source, int length, std::string &destination, Transform trans) |
int | convert (const std::string &source, std::string &destination, Transform trans) |
Destroys the TextConverter. | |
TextConverter (const TextEncoding &inEncoding, const TextEncoding &outEncoding, int defaultChar= '?') | |
Transform function for convert. | |
~TextConverter () | |
Private Member Functions | |
TextConverter & | operator= (const TextConverter &) |
TextConverter (const TextConverter &) | |
TextConverter () | |
Private Attributes | |
int | _defaultChar |
const TextEncoding & | _inEncoding |
const TextEncoding & | _outEncoding |
A TextConverter converts strings from one encoding into another.
Definition at line 52 of file TextConverter.h.
typedef int(* Poco::TextConverter::Transform)(int) |
Definition at line 57 of file TextConverter.h.
Poco::TextConverter::TextConverter | ( | const TextEncoding & | inEncoding, | |
const TextEncoding & | outEncoding, | |||
int | defaultChar = '?' | |||
) |
Transform function for convert.
Definition at line 53 of file TextConverter.cpp.
Poco::TextConverter::~TextConverter | ( | ) |
Creates the TextConverter. The encoding objects must not be deleted while the TextConverter is in use.
Definition at line 61 of file TextConverter.cpp.
Poco::TextConverter::TextConverter | ( | ) | [private] |
Converts the source buffer from inEncoding to outEncoding and appends the result to destination. If a character cannot be represented in outEncoding, defaultChar is used instead. Returns the number of encoding errors (invalid byte sequences in source).
Poco::TextConverter::TextConverter | ( | const TextConverter & | ) | [private] |
int Poco::TextConverter::convert | ( | const void * | source, | |
int | length, | |||
std::string & | destination | |||
) |
Converts the source string from inEncoding to outEncoding and appends the result to destination. If a character cannot be represented in outEncoding, defaultChar is used instead. Returns the number of encoding errors (invalid byte sequences in source).
Definition at line 143 of file TextConverter.cpp.
int Poco::TextConverter::convert | ( | const std::string & | source, | |
std::string & | destination | |||
) |
Converts the source buffer from inEncoding to outEncoding and appends the result to destination. Every character is passed to the transform function. If a character cannot be represented in outEncoding, defaultChar is used instead. Returns the number of encoding errors (invalid byte sequences in source).
Definition at line 137 of file TextConverter.cpp.
int Poco::TextConverter::convert | ( | const void * | source, | |
int | length, | |||
std::string & | destination, | |||
Transform | trans | |||
) |
Converts the source string from inEncoding to outEncoding and appends the result to destination. Every character is passed to the transform function. If a character cannot be represented in outEncoding, defaultChar is used instead. Returns the number of encoding errors (invalid byte sequences in source).
Definition at line 88 of file TextConverter.cpp.
int Poco::TextConverter::convert | ( | const std::string & | source, | |
std::string & | destination, | |||
Transform | trans | |||
) |
Destroys the TextConverter.
Definition at line 66 of file TextConverter.cpp.
TextConverter& Poco::TextConverter::operator= | ( | const TextConverter & | ) | [private] |
int Poco::TextConverter::_defaultChar [private] |
Definition at line 108 of file TextConverter.h.
const TextEncoding& Poco::TextConverter::_inEncoding [private] |
Definition at line 106 of file TextConverter.h.
const TextEncoding& Poco::TextConverter::_outEncoding [private] |
Definition at line 107 of file TextConverter.h.