An output filter layer to write base-64 encoded content. More...
#include <base64Layer.H>

Public Member Functions | |
| base64Layer (std::ostream &os) noexcept | |
| Attach to an output stream. | |
| base64Layer (const base64Layer &)=delete | |
| No copy construct. | |
| void | operator= (const base64Layer &)=delete |
| No copy assignment. | |
| ~base64Layer () | |
| Destructor. Performs close(). | |
| void | write (const char *s, std::streamsize n) |
| Encode the character sequence, writing when possible. | |
| void | reset () noexcept |
| Restart a new encoding sequence. | |
| bool | close () |
| End the encoding sequence, padding the final characters with '='. | |
Static Public Member Functions | |
| static constexpr std::size_t | encodedLength (std::size_t len) noexcept |
| The encoded length has 4 bytes out for every 3 bytes and any trailing bytes are padded with '='. | |
Protected Member Functions | |
| void | add (char c) |
| Add a character to the group, outputting when the group is full. | |
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.
|
explicitnoexcept |
Attach to an output stream.
Definition at line 99 of file base64Layer.C.
References Foam::noexcept, and os().
Referenced by base64Layer(), and operator=().


|
delete |
| ~base64Layer | ( | ) |
Destructor. Performs close().
Definition at line 108 of file base64Layer.C.
References close().

|
protected |
Add a character to the group, outputting when the group is full.
Definition at line 91 of file base64Layer.C.
|
delete |
|
inlinestaticconstexprnoexcept |
The encoded length has 4 bytes out for every 3 bytes and any trailing bytes are padded with '='.
The output length is (4*ceil(len / 3.0))
Definition at line 127 of file base64Layer.H.
| void write | ( | const char * | s, |
| std::streamsize | n ) |
Encode the character sequence, writing when possible.
Definition at line 116 of file base64Layer.C.

|
noexcept |
Restart a new encoding sequence.
Definition at line 125 of file base64Layer.C.
References Foam::noexcept.
| bool close | ( | ) |
End the encoding sequence, padding the final characters with '='.
Definition at line 131 of file base64Layer.C.
Referenced by ~base64Layer().
