namespace Akenti class Base64Impl

This abstract class provides part of the functionality of the Base 64 encoding/decoding

Inheritance:


Public Methods

virtual ~Base64Impl ()
Destroys this object
void encodeInit ()
Initializes the engine to the encoding state
void encodeUpdate (const string& data)
Updates the encoding engine with data
void encodeUpdate (const string& data, int offset, int len)
Updates the encoding engine with data
string encode ()
Completes the encoding of the data that has been processed through the engine
void decodeInit ()
Initializes the engine to the decoding state
void decodeUpdate (const string& data)
Updates the decoding engine with data
void decodeUpdate (const string& data, int offset, int len)
Updates the decoding engine with data
string decode ()
Completes the decoding of the data that has been processed through the engine

Protected Methods

Base64Impl ()
Constructs this object in the uninitalized state
virtual void doEncodeInit ()
Initilizes the engine to the encoding state
virtual void doDecodeInit ()
Initilizes the engine to the decoding state
virtual string doEncode ()
Completes the encoding of the data that has been processed through the engine
virtual string doDecode ()
Completes the decoding of the data that has been processed through the engine
virtual void doEncodeUpdate (const string& data, int offset, int len)
Updates the encoding engine with data
virtual void doDecodeUpdate (const string& enc, int offset, int len)
Updates the decoding engine with encoded string

Documentation

This abstract class provides part of the functionality of the Base 64 encoding/decoding. The rest of the functionality is provided by the subclass implementors. Typically the clients will not deal with an instance of this class directly, instead they interact with the Base64 reference-count pointer.
Usage
try {
string data = "1234567890";
string enc = Base64::encode(data);
string dec = Base64::decode(enc);

if (dec == enc) {
cout << "** Base64 Encoding/Decoding WORKED **";
} else {
cout << "!! Base64 Encoding/Decoding FAILED !!";
}
} catch(Exception& ex) {.....}
virtual ~Base64Impl()
Destroys this object

void encodeInit()
Initializes the engine to the encoding state.
See Also:
doEncodeInit()

void encodeUpdate(const string& data)
Updates the encoding engine with data.
Throws:
Error encodeInit() has not been called
Error if the input buffer is too short
Parameters:
data - string used to update the engine
See Also:
encodeInit
encodeUpdate(string, int, int)

void encodeUpdate(const string& data, int offset, int len)
Updates the encoding engine with data.
Throws:
Error encodeInit() has not been called
Error if the input buffer is too short
Parameters:
data - string used to update the engine
offset - int index in data to start reading bytes from
len - int number of bytes used to update the engine
See Also:
encodeInit
doEncodeUpdate(string, int, int)

string encode()
Completes the encoding of the data that has been processed through the engine. Resets engine state to UNINITIALIZED.
Throws:
Error if encodeInit() has not been called
Returns:
the Base64 encoding
See Also:
doEncode()

void decodeInit()
Initializes the engine to the decoding state.
See Also:
doDecodeInit()

void decodeUpdate(const string& data)
Updates the decoding engine with data.
Throws:
Error decodeInit() has not been called
Error if the input buffer is too short
SecurityException if decoding fails
Parameters:
data - string used to update the engine
See Also:
decodeInit
decodeUpdate(string, int, int)

void decodeUpdate(const string& data, int offset, int len)
Updates the decoding engine with data.
Throws:
Error decodeInit() has not been called
Error if the input buffer is too short
SecurityException if decoding fails
Parameters:
data - string used to update the engine
offset - int index in data to start reading bytes from
len - int number of bytes used to update the engine
See Also:
decodeInit
doDecodeUpdate(string, int, int)

string decode()
Completes the decoding of the data that has been processed through the engine. Resets the engine state to UNINITIALIZED.
Throws:
Error if decodeInit() has not been called
SecurityException if decoding fails
Returns:
the Base64 decoding
See Also:
doDecode()

Base64Impl()
Constructs this object in the uninitalized state. one must call encodeInit() to change to ENCODING state for encoding purposes. one must call decodeInit() to change to DECODING state for decoding purposes.
See Also:
encodeInit()
decodeInit()

virtual void doEncodeInit()
Initilizes the engine to the encoding state

virtual void doDecodeInit()
Initilizes the engine to the decoding state

virtual string doEncode()
Completes the encoding of the data that has been processed through the engine

virtual string doDecode()
Completes the decoding of the data that has been processed through the engine.
Throws:
SecurityException if decoding fails

virtual void doEncodeUpdate(const string& data, int offset, int len)
Updates the encoding engine with data.
Parameters:
data - string used to update the engine
offset - int index in data to start reading bytes from
len - int number of bytes used to update the engine

virtual void doDecodeUpdate(const string& enc, int offset, int len)
Updates the decoding engine with encoded string.
Throws:
SecurityException if decoding fails
Parameters:
enc - string used to update the engine
offset - int index in data to start reading bytes from
len - int number of bytes used to update the engine


Direct child classes:
OpenSSLBase64Impl
Author:
Srilekha Mudumbai Abdelilah Essiari Xiang Sun
Version:
1.1 00/05/01
See Also:
Base64
Provider
getProvider()

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de