VMime
charsetConverter Class Referenceabstract
Inheritance diagram for charsetConverter:
Collaboration diagram for charsetConverter:

Classes

struct  status
 

Public Member Functions

virtual void convert (const string &in, string &out, status *st=NULL)=0
 
virtual void convert (utility::inputStream &in, utility::outputStream &out, status *st=NULL)=0
 
virtual shared_ptr
< utility::charsetFilteredOutputStream
getFilteredOutputStream (utility::outputStream &os, const charsetConverterOptions &opts=charsetConverterOptions())=0
 

Static Public Member Functions

static shared_ptr
< charsetConverter
create (const charset &source, const charset &dest, const charsetConverterOptions &opts=charsetConverterOptions())
 

Additional Inherited Members

- Protected Member Functions inherited from object
 object ()
 
 object (const object &)
 
objectoperator= (const object &)
 
virtual ~object ()
 

Detailed Description

Convert between charsets.

Member Function Documentation

virtual void convert ( const string in,
string out,
status st = NULL 
)
pure virtual

Convert a string buffer from one charset to another charset (in-memory conversion)

Deprecated:
Use the new convert() method, which takes an outputStream parameter.
Parameters
ininput buffer
outoutput buffer
stwill receive some extra infos when conversion is finished or stopped by an error (can be NULL)
Exceptions
exceptions::illegal_byte_sequence_for_charsetif an illegal byte sequence was found in the input bytes, and the 'silentlyReplaceInvalidSequences' flag is set to false in the charsetConverterOptions
exceptions::charset_conv_errorif an unexpected error occured during the conversion

Implemented in charsetConverter_idna.

virtual void convert ( utility::inputStream in,
utility::outputStream out,
status st = NULL 
)
pure virtual

Convert the contents of an input stream in a specified charset to another charset and write the result to an output stream.

Parameters
ininput stream to read data from
outoutput stream to write the converted data
stwill receive some extra infos when conversion is finished or stopped by an error (can be NULL)
Exceptions
exceptions::illegal_byte_sequence_for_charsetif an illegal byte sequence was found in the input bytes, and the 'silentlyReplaceInvalidSequences' flag is set to false in the charsetConverterOptions
exceptions::charset_conv_errorif an unexpected error occured during the conversion

Implemented in charsetConverter_idna.

shared_ptr< charsetConverter > create ( const charset source,
const charset dest,
const charsetConverterOptions opts = charsetConverterOptions() 
)
static

Construct and initialize an iconv charset converter.

Parameters
sourceinput charset
destoutput charset
optsconversion options

Referenced by charset::convert(), wordEncoder::getNextChunk(), and charset::isValidText().

virtual shared_ptr<utility::charsetFilteredOutputStream> getFilteredOutputStream ( utility::outputStream os,
const charsetConverterOptions opts = charsetConverterOptions() 
)
pure virtual

Returns a filtered output stream which applies a charset conversion to input bytes.

Please note that it may not be supported by the converter.

Parameters
osstream into which filtered data will be written
optsconversion options
Returns
a filtered output stream, or NULL if not supported

Implemented in charsetConverter_idna.


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