An output filter layer to write base-64 encoded content. More...
Public Member Functions | |
base64Layer (std::ostream &os) | |
Construct and attach to an output stream. More... | |
~base64Layer () | |
Destructor. Performs close() More... | |
void | write (const char *s, std::streamsize n) |
Encode the character sequence, writing when possible. More... | |
void | reset () |
Restart a new encoding sequence. More... | |
bool | close () |
End the encoding sequence, padding the final characters with '='. More... | |
Static Public Member Functions | |
static std::size_t | encodedLength (std::size_t n) |
The encoded length has 4 bytes out for every 3 bytes in. More... | |
Protected Member Functions | |
void | add (char c) |
Add a character to the group, outputting when the group is full. More... | |
base64Layer (const base64Layer &)=delete | |
No copy construct. More... | |
void | operator= (const base64Layer &)=delete |
No copy assignment. More... | |
An output filter layer to write base-64 encoded content.
Base64 encoding according to RFC 4648 specification (https://tools.ietf.org/html/rfc4648#page-5). It is the obligation of the caller to avoid using normal output while the base-64 encoding layer is actively used.
Definition at line 51 of file base64Layer.H.
|
protecteddelete |
No copy construct.
|
explicit |
Construct and attach to an output stream.
Definition at line 100 of file base64Layer.C.
~base64Layer | ( | ) |
Destructor. Performs close()
Definition at line 111 of file base64Layer.C.
|
protected |
Add a character to the group, outputting when the group is full.
Definition at line 78 of file base64Layer.C.
References Foam::constant::universal::c.
Referenced by foamVtkBase64Layer::write().
|
protecteddelete |
No copy assignment.
|
static |
The encoded length has 4 bytes out for every 3 bytes in.
Definition at line 45 of file base64Layer.C.
References n.
Referenced by foamVtkBase64Layer::encodedLength().
void write | ( | const char * | s, |
std::streamsize | n | ||
) |
Encode the character sequence, writing when possible.
Definition at line 119 of file base64Layer.C.
References Foam::add(), n, and s.
Referenced by foamVtkBase64Layer::write().
void reset | ( | ) |
Restart a new encoding sequence.
Definition at line 128 of file base64Layer.C.
bool close | ( | ) |
End the encoding sequence, padding the final characters with '='.
Definition at line 135 of file base64Layer.C.
Referenced by base64Formatter::flush(), foamVtkBase64Layer::flush(), appendBase64Formatter::~appendBase64Formatter(), base64Formatter::~base64Formatter(), and foamVtkBase64Layer::~foamVtkBase64Layer().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.