class Base64

Base64 encoder/decoder class. More...

Full nameTelEngine::Base64
Definition#include <yateclass.h>
InheritsTelEngine::DataBlock [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

Base64 encoder/decoder class

inline  Base64 ()

Base64

Constructor

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

Base64

Constructor. Set the buffer

Parameters:
srcInitial data buffer
lenInitial data buffer length
copyDataTrue to make a copy of the received data

void  encode (String& dest, unsigned int lineLen = 0, bool lineAtEnd = false)

encode

Encode this buffer to a destination string

Parameters:
destDestination string
lineLenThe 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
lineAtEndTrue to add a line break at the end of encoded data

bool  decode (DataBlock& dest, bool liberal = true)

decode

Decode this buffer to a destination one

Parameters:
destDestination data buffer
liberalTrue 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

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

operator<<

Base64 append operator for Strings

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

operator<<

Base64 append operator for DataBlocks

inline Base64&  operator<< (const char* value)

operator<<

Base64 append operator for C strings


Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.