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

Public Member Functions

 b64Encoder ()
 
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 Protected Attributes

static const unsigned char sm_alphabet []
 
static const unsigned char sm_decodeMap [256]
 

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

Base64 encoder.

Constructor & Destructor Documentation

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 vmime::count(), inputStream::eof(), parserHelpers::isSpace(), progressListener::progress(), inputStream::read(), inputStream::reset(), b64Encoder::sm_decodeMap, progressListener::start(), 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 vmime::count(), inputStream::eof(), encoder::getProperties(), propertySet::getProperty(), progressListener::progress(), inputStream::read(), inputStream::reset(), b64Encoder::sm_alphabet, progressListener::start(), progressListener::stop(), and outputStream::write().

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().

Member Data Documentation

const unsigned char sm_alphabet
staticprotected
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="

Referenced by b64Encoder::encode().

const unsigned char sm_decodeMap
staticprotected
Initial value:
=
{
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3e,0xff,0xff,0xff,0x3f,
0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0xff,0xff,0xff,0x3d,0xff,0xff,
0xff,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,
0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0xff,0xff,0xff,0xff,0xff,
0xff,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
}

Referenced by b64Encoder::decode().


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