charset Class Reference

Charset description (basic type). More...

Inheritance diagram for charset:
Inheritance graph
[legend]
Collaboration diagram for charset:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 charset ()
 charset (const string &name)
 charset (const char *name)
const stringgetName () const
charsetoperator= (const charset &other)
bool operator== (const charset &value) const
bool operator!= (const charset &value) const
const std::vector< ref< const
component > > 
getChildComponents () const
ref< componentclone () const
void copyFrom (const component &other)
void parse (const string &buffer, const string::size_type position, const string::size_type end, string::size_type *newPosition=NULL)
void generate (utility::outputStream &os, const string::size_type maxLineLength=lineLengthLimits::infinite, const string::size_type curLinePos=0, string::size_type *newLinePos=NULL) const

Static Public Member Functions

static const charset getLocaleCharset ()
static void convert (const string &in, string &out, const charset &source, const charset &dest)
static void convert (utility::inputStream &in, utility::outputStream &out, const charset &source, const charset &dest)

Detailed Description

Charset description (basic type).


Constructor & Destructor Documentation

charset (  ) 
charset ( const string name  ) 
charset ( const char *  name  ) 

Member Function Documentation

ref< component > clone (  )  const [virtual]

Clone this component.

Returns:
a copy of this component

Implements component.

void convert ( utility::inputStream in,
utility::outputStream out,
const charset source,
const charset dest 
) [static]

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

Parameters:
in input stream to read data from
out output stream to write the converted data
source input charset
dest output charset
Exceptions:
exceptions::charset_conv_error if an error occured during the conversion
void convert ( const string in,
string out,
const charset source,
const charset dest 
) [static]

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:
in input buffer
out output buffer
source input charset
dest output charset
Exceptions:
exceptions::charset_conv_error if an error occured during the conversion

Referenced by wordEncoder::wordEncoder().

void copyFrom ( const component other  )  [virtual]

Replace data in this component by data in other component.

Both components must be of the same type.

Exceptions:
std::bad_cast_exception if the components are not of the same (dynamic) type
Parameters:
other other component to copy data from

Implements component.

void generate ( utility::outputStream os,
const string::size_type  maxLineLength = lineLengthLimits::infinite,
const string::size_type  curLinePos = 0,
string::size_type *  newLinePos = NULL 
) const [virtual]

Generate RFC-2822/MIME data for this component.

Parameters:
os output stream
maxLineLength maximum line length for output
curLinePos length of the current line in the output buffer
newLinePos will receive the new line position (length of the last line written)

Implements component.

const std::vector< ref< const component > > getChildComponents (  )  const [virtual]

Return the list of children of this component (const version).

Returns:
list of child components

Implements component.

const charset getLocaleCharset (  )  [static]

Returns the default charset used on the system.

This function simply calls platformHandler::getLocaleCharset() and is provided for convenience.

Returns:
system default charset

Referenced by text::text(), and word::word().

const string & getName (  )  const

Return the ISO name of the charset.

Returns:
charset name

Referenced by charsetConverter::charsetConverter(), charsetFilteredOutputStream::charsetFilteredOutputStream(), and parameter::generate().

bool operator!= ( const charset value  )  const
charset & operator= ( const charset other  ) 
bool operator== ( const charset value  )  const
void parse ( const string buffer,
const string::size_type  position,
const string::size_type  end,
string::size_type *  newPosition = NULL 
) [virtual]

Parse RFC-822/MIME data for this component.

Parameters:
buffer input buffer
position current position in the input buffer
end end position in the input buffer
newPosition will receive the new position in the input buffer

Implements component.


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

Generated by  doxygen 1.6.2