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:
buffered_codec codec

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 ( int  maxlen = default_maxlen)
inline

Constructor, maxlen is the maximum length of every encoded line

Member Function Documentation

double codeSizeMultiplier ( ) const
inlinevirtual

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

Reimplemented from codec.

void flush ( OutIt &  out)
inline

Write to out any buffered encoded char.

const char* name ( ) const
inlinevirtual

Returns the name of the codec ("Base64")

Implements codec.

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

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

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()

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