#include <icy/base64.h>Inherits:
Encoder
Base64 encoder.
| Return | Name | Description |
|---|---|---|
internal::encodestate | _state | |
int | _buffersize |
internal::encodestate _stateint _buffersize| Return | Name | Description |
|---|---|---|
Encoder inline | #### Parameters | |
void | encode inline | Encodes the entire input stream and writes Base64 output to ostrm. Resets the encoder state after completion. |
void | encode inline | Encodes a string to Base64 and appends the result to out. Resets the encoder state after completion. |
ssize_t | encode virtual inline | Encodes a raw buffer, writing Base64 characters to outbuf. May be called multiple times before calling [finalize()](#finalize-4). |
ssize_t | finalize virtual inline | Writes any pending padding and resets the encoder state. Must be called once after all [encode()](#encode-17) calls to flush the final block. |
void | setLineLength inline | Sets the line wrap length for encoded output (0 disables line wrapping). |
inline
inline Encoder(int buffersize)buffersize Internal read buffer size in bytes.inline
inline void encode(std::istream & istrm, std::ostream & ostrm)Encodes the entire input stream and writes Base64 output to ostrm. Resets the encoder state after completion.
istrm Source stream to encode.
ostrm Destination stream for Base64 output.
inline
inline void encode(const std::string & in, std::string & out)Encodes a string to Base64 and appends the result to out. Resets the encoder state after completion.
in Input string.
out Output string to which Base64 characters are appended.
virtual inline
virtual inline ssize_t encode(const char * inbuf, size_t nread, char * outbuf)Encodes a raw buffer, writing Base64 characters to outbuf. May be called multiple times before calling [finalize()](#finalize-4).
inbuf Input binary data.
nread Number of bytes to encode.
outbuf Output buffer; must be at least nread * 4 / 3 + 4 bytes.
Number of Base64 characters written.
virtual inline
virtual inline ssize_t finalize(char * outbuf)Writes any pending padding and resets the encoder state. Must be called once after all [encode()](#encode-17) calls to flush the final block.
outbuf Output buffer; must be at least 5 bytes.Number of characters written.
inline
inline void setLineLength(int lineLength)Sets the line wrap length for encoded output (0 disables line wrapping).
lineLength Characters per line; use 0 to disable.