base64::Encoder
Encoder
#include <icy/base64.h>struct EncoderDefined in src/base/include/icy/base64.h:102
Inherits:
Encoder
Base64 encoder.
List of all members
| Name | Kind | Owner |
|---|---|---|
_state | variable | Declared here |
_buffersize | variable | Declared here |
Encoder | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
finalize | function | Declared here |
setLineLength | function | Declared here |
Encoder | function | Inherited from Encoder |
~Encoder | function | Inherited from Encoder |
encode | function | Inherited from Encoder |
finalize | function | Inherited from Encoder |
Inherited from Encoder
| Kind | Name | Description |
|---|---|---|
function | Encoder | Defaulted constructor. |
function | ~Encoder virtual | Defaulted destructor. |
function | encode virtual | Encodes nread bytes from inbuf and writes encoded output to outbuf. |
function | finalize virtual inline | Flushes any buffered state and writes final output to outbuf. |
Public Attributes
| Return | Name | Description |
|---|---|---|
internal::encodestate | _state | |
int | _buffersize |
_state
internal::encodestate _stateDefined in src/base/include/icy/base64.h:178
_buffersize
int _buffersizeDefined in src/base/include/icy/base64.h:179
Public Methods
| Return | Name | Description |
|---|---|---|
Encoder inline | ||
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 override | Encodes a raw buffer, writing Base64 characters to outbuf. May be called multiple times before calling [finalize()](#finalize-4). |
ssize_t | finalize virtual inline override | 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). |
Encoder
inline
inline Encoder(int buffersize = BUFFER_SIZE)Defined in src/base/include/icy/base64.h:105
Parameters
buffersizeInternal read buffer size in bytes.
encode
inline
inline void encode(std::istream & istrm, std::ostream & ostrm)Defined in src/base/include/icy/base64.h:115
Encodes the entire input stream and writes Base64 output to ostrm. Resets the encoder state after completion.
Parameters
istrmSource stream to encode.ostrmDestination stream for Base64 output.
encode
inline
inline void encode(const std::string & in, std::string & out)Defined in src/base/include/icy/base64.h:141
Encodes a string to Base64 and appends the result to out. Resets the encoder state after completion.
Parameters
inInput string.outOutput string to which Base64 characters are appended.
encode
virtual inline override
virtual inline ssize_t encode(const char * inbuf, size_t nread, char * outbuf) overrideDefined in src/base/include/icy/base64.h:160
Encodes a raw buffer, writing Base64 characters to outbuf. May be called multiple times before calling [finalize()](#finalize-4).
Parameters
inbufInput binary data.nreadNumber of bytes to encode.outbufOutput buffer; must be at leastnread * 4 / 3 + 4bytes.
Returns
Number of Base64 characters written.
Reimplements
finalize
virtual inline override
virtual inline ssize_t finalize(char * outbuf) overrideDefined in src/base/include/icy/base64.h:169
Writes any pending padding and resets the encoder state. Must be called once after all [encode()](#encode-17) calls to flush the final block.
Parameters
outbufOutput buffer; must be at least 5 bytes.
Returns
Number of characters written.
Reimplements
setLineLength
inline
inline void setLineLength(int lineLength)Defined in src/base/include/icy/base64.h:176
Sets the line wrap length for encoded output (0 disables line wrapping).
Parameters
lineLengthCharacters per line; use 0 to disable.
