Main Page Class Hierarchy Alphabetical List Compound List Examples

Public Member Functions | List of all members
Base64::Encoder Class Reference

Base64 encoder. More...

`#include <base64.h>`

Inheritance diagram for Base64::Encoder:

## Public Member Functions

double | codeSizeMultiplier () const
| Encoder (int maxlen=default_maxlen)
const char * | name () const
template<typename InIt, typename OutIt>
void | process (InIt bit, InIt eit, OutIt out)
template<typename OutIt>
void | process (char_type c, OutIt &out)
template<typename OutIt>
void | flush (OutIt &out)

## Additional Inherited Members

Public Types inherited from buffered_codec
typedef buffered_codec_type_tag | codec_type
Public Types inherited from codec
typedef unsigned char | char_type

## Detailed Description

Base64 encoder.

See also
  encode decode

## Constructor & Destructor Documentation

## ◆ Encoder()

Encoder | ( | int | maxlen = default_maxlen | ) |

inline

Constructor, maxlen is the maximum length of every encoded line

## Member Function Documentation

## ◆ codeSizeMultiplier()

double codeSizeMultiplier | ( |  | ) | const

inline virtual

return the multiplier of the required (max) size of the output buffer when encoding

Reimplemented from codec.

## ◆ flush()

template<typename OutIt>

void flush | ( | OutIt & | out | ) |

inline

Write to `out` any buffered encoded char.

## ◆ name()

const char * name | ( |  | ) | const

inline virtual

Returns the name of the codec ("Base64")

Implements codec.

## ◆ process() [1/2]

template<typename OutIt>

void process | ( | char_type | c,
|  | OutIt & | out )

inline

Encodes `c` and write any encoded output char to `out`.

Warning
  You must call flush() when all chars have been processed by the encode funcion.
  while( (c = getchar()) != EOF )
  b64.encode(c, out);
  b64.flush();

See also
  flush()

## ◆ process() [2/2]

template<typename InIt, typename OutIt>

void process | ( | InIt | bit,
|  | InIt | eit,
|  | OutIt | out )

inline

Encodes [`bit`,`eit`) and write any encoded char to `out`.

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

- base64.h