encoding Class Reference

Content encoding (basic type). More...

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

List of all members.

Public Member Functions

 encoding ()
 encoding (const string &name)
 encoding (const encoding &enc)
const stringgetName () const
void setName (const string &name)
encodingoperator= (const encoding &other)
encodingoperator= (const string &name)
bool operator== (const encoding &value) const
bool operator!= (const encoding &value) const
const std::vector< ref< const
component > > 
getChildComponents () const
ref< componentclone () const
void copyFrom (const component &other)
ref< utility::encoder::encodergetEncoder () const
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 encoding decide (const string::const_iterator begin, const string::const_iterator end)
static const encoding decide (ref< const contentHandler > data)

Detailed Description

Content encoding (basic type).


Constructor & Destructor Documentation

encoding (  ) 

Referenced by encoding::decide().

encoding ( const string name  )  [explicit]
encoding ( const encoding enc  ) 

Member Function Documentation

ref< component > clone (  )  const [virtual]

Clone this component.

Returns:
a copy of this component

Implements component.

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.

Referenced by encoding::operator=().

const encoding decide ( ref< const contentHandler data  )  [static]

Decide which encoding to use based on the specified data.

Parameters:
data data used to determine encoding
Returns:
suitable encoding for specified data

References vmime::encodingTypes::BASE64, and encoding::encoding().

const encoding decide ( const string::const_iterator  begin,
const string::const_iterator  end 
) [static]

Decide which encoding to use based on the specified data.

Deprecated:
Use the new decide() method which takes a contentHandler parameter.
Parameters:
begin start iterator in buffer
end end iterator in buffer
Returns:
suitable encoding for specified data

References vmime::encodingTypes::BASE64, vmime::lineLengthLimits::convenient, vmime::count(), vmime::encodingTypes::QUOTED_PRINTABLE, and vmime::encodingTypes::SEVEN_BIT.

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.

Referenced by encoding::getEncoder().

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.

ref< utility::encoder::encoder > getEncoder (  )  const

Use encoderFactory to obtain an encoder/decoder object for the current encoding type.

Exceptions:
exceptions::no_encoder_available if no encoder is registered for the encoding
Returns:
a new encoder object for the encoding type

References encoding::generate(), and encoderFactory::getInstance().

Referenced by stringContentHandler::extract(), streamContentHandler::extract(), stringContentHandler::generate(), and streamContentHandler::generate().

const string & getName (  )  const

Return the name of the encoding.

See the constants in vmime::encodingTypes.

Returns:
name of the encoding (eg. "quoted-printable")
bool operator!= ( const encoding value  )  const
encoding & operator= ( const string name  ) 
encoding & operator= ( const encoding other  ) 

References encoding::copyFrom().

bool operator== ( const encoding 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.

References component::setParsedBounds(), vmime::encodingTypes::SEVEN_BIT, stringUtils::toLower(), stringUtils::trim(), and stringUtils::unquote().

void setName ( const string name  ) 

Set the name of the encoding.

See the constants in vmime::encodingTypes.

Parameters:
name name of the encoding

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

Generated by  doxygen 1.6.2