# class Base64

Base64 encoder/decoder class. More...

Full name | `TelEngine::Base64`
Definition | `#include <yateclass.h>`
Inherits | TelEngine::DataBlock [public ]
List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- inline Base64 ()
- inline 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)
- inline Base64& operator<< (const String& value)
- inline Base64& operator<< (const DataBlock& data)
- inline Base64& operator<< (const char* value)

## 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:

src | Initial data buffer
len | Initial data buffer length
copyData | True 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:

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

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

### decode

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

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.