Base64 Class Reference

Base64 encoder/decoder class. More...

#include <yateclass.h>

Inheritance diagram for Base64:
DataBlock GenObject

List of all members.

Public Member Functions

 Base64 ()
 Base64 (void *src, unsigned int len, bool copyData=true)
void encode (String &dest, unsigned int lineLen=0, bool lineAtEnd=false)
bool decode (DataBlock &dest, bool liberal=true)
Base64operator<< (const String &value)
Base64operator<< (const DataBlock &data)
Base64operator<< (const char *value)

Detailed Description

Base64 encoder/decoder class.

Base64 encoder/decoder class


Constructor & Destructor Documentation

Base64 (  )  [inline]

Constructor

Base64 ( void *  src,
unsigned int  len,
bool  copyData = true 
) [inline]

Constructor. Set the buffer

Parameters:
src Initial data buffer
len Initial data buffer length
copyData True to make a copy of the received data

Member Function Documentation

bool decode ( DataBlock dest,
bool  liberal = true 
)

Decode this buffer to a destination one

Parameters:
dest Destination data buffer
liberal True to use 'liberal' rules when decoding. Some non alphabet characters (such as CR, LF, TAB, SPACE or the Base64 padding char '=') will be accepted and ignored. The resulting number of Base64 chars to decode must be a valid one
Returns:
True on succes, false if an invalid (non Base64) character was found or the number of Base64 characters is invalid (must be a multiple of 4 plus 0, 2 or 3 characters) or the padding is incorrect
void encode ( String dest,
unsigned int  lineLen = 0,
bool  lineAtEnd = false 
)

Encode this buffer to a destination string

Parameters:
dest Destination string
lineLen The length of a line. If non 0, a line break (CR/LF) will be inserted in the encoded data after each lineLine characters. No line break will be added after the last line. Use the lineAtEnd parameter to do that
lineAtEnd True to add a line break at the end of encoded data
Base64& operator<< ( const char *  value  )  [inline]

Base64 append operator for C strings

References Base64::operator<<().

Referenced by Base64::operator<<().

Base64& operator<< ( const DataBlock data  )  [inline]

Base64 append operator for DataBlocks

Base64& operator<< ( const String value  )  [inline]

Base64 append operator for Strings


The documentation for this class was generated from the following file:
Generated on Thu Apr 8 18:22:35 2010 for Yate by  doxygen 1.6.3