VMime
qpEncoder Class Reference
Inheritance diagram for qpEncoder:
Collaboration diagram for qpEncoder:

Public Member Functions

 qpEncoder ()
 
size_t encode (utility::inputStream &in, utility::outputStream &out, utility::progressListener *progress=NULL)
 
size_t decode (utility::inputStream &in, utility::outputStream &out, utility::progressListener *progress=NULL)
 
const std::vector< stringgetAvailableProperties () const
 
size_t getEncodedSize (const size_t n) const
 
size_t getDecodedSize (const size_t n) const
 
- Public Member Functions inherited from encoder
 encoder ()
 
virtual ~encoder ()
 
const propertySetgetProperties () const
 
propertySetgetProperties ()
 
const propertySetgetResults () const
 

Static Public Member Functions

static bool RFC2047_isEncodingNeededForChar (const unsigned char c)
 
static int RFC2047_getEncodedLength (const unsigned char c)
 

Static Protected Attributes

static const unsigned char sm_hexDigits [17] = "0123456789ABCDEF"
 
static const unsigned char sm_hexDecodeTable [256]
 
static const unsigned char sm_RFC2047EncodeTable [128]
 

Additional Inherited Members

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

Detailed Description

Quoted-printable encoder.

Constructor & Destructor Documentation

qpEncoder ( )

Member Function Documentation

size_t decode ( utility::inputStream in,
utility::outputStream out,
utility::progressListener progress = NULL 
)
virtual

Decode data.

Parameters
ininput data (encoded)
outoutput stream for decoded data
progressprogress listener, or NULL if you do not want to receive progress notifications
Returns
number of bytes written into output stream

Implements encoder.

References inputStream::eof(), encoder::getProperties(), propertySet::getProperty(), progressListener::progress(), inputStream::read(), inputStream::reset(), qpEncoder::sm_hexDecodeTable, and progressListener::stop().

size_t encode ( utility::inputStream in,
utility::outputStream out,
utility::progressListener progress = NULL 
)
virtual

Encode data.

Parameters
ininput data (decoded)
outoutput stream for encoded data
progressprogress listener, or NULL if you do not want to receive progress notifications
Returns
number of bytes written into output stream

Implements encoder.

References inputStream::eof(), encoder::getProperties(), propertySet::getProperty(), progressListener::progress(), inputStream::read(), inputStream::reset(), qpEncoder::sm_RFC2047EncodeTable, progressListener::start(), and progressListener::stop().

const std::vector< string > getAvailableProperties ( ) const
virtual

Return a list of property names that can be set for this encoder.

Returns
list of property names

Reimplemented from encoder.

References encoder::getAvailableProperties().

size_t getDecodedSize ( const size_t  n) const
virtual

Return the encoded size for the specified input (encoded) size.

If the size is not exact, it may be an estimate which should always be larger than the actual decoded size.

Parameters
ncount of input (encoded) bytes
Returns
count of output (decoded) bytes

Implements encoder.

size_t getEncodedSize ( const size_t  n) const
virtual

Return the encoded size for the specified input (decoded) size.

If the size is not exact, it may be an estimate which should always be larger than the actual encoded size.

Parameters
ncount of input (decoded) bytes
Returns
count of output (encoded) bytes

Implements encoder.

References encoder::getProperties(), and propertySet::getProperty().

int RFC2047_getEncodedLength ( const unsigned char  c)
static
bool RFC2047_isEncodingNeededForChar ( const unsigned char  c)
static

Member Data Documentation

const vmime_uint8 sm_hexDecodeTable
staticprotected
Initial value:
=
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0,
0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}

Referenced by qpEncoder::decode().

const unsigned char sm_hexDigits = "0123456789ABCDEF"
staticprotected
const vmime_uint8 sm_RFC2047EncodeTable
staticprotected
Initial value:
=
{
1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 1,
1, 1, 1, 1, 1, 1,
0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 1,
1, 1, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1,
1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1,
1, 1
}

Referenced by qpEncoder::encode(), qpEncoder::RFC2047_getEncodedLength(), and qpEncoder::RFC2047_isEncodingNeededForChar().


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