base64::Encoder
Encoder
#include <icy/base64.h>
struct EncoderDefined in src/base/include/icy/base64.h:102
- Inherits
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(). |
ssize_t | finalize virtual inline override | Writes any pending padding and resets the encoder state. Must be called once after all encode() 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
| Parameter | Type | Description |
|---|---|---|
buffersize | int | Internal 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
| Parameter | Type | Description |
|---|---|---|
istrm | std::istream & | Source stream to encode. |
ostrm | std::ostream & | Destination 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
| Parameter | Type | Description |
|---|---|---|
in | const std::string & | Input string. |
out | std::string & | Output 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().
Returns
Number of Base64 characters written.
Reimplements
Parameters
| Parameter | Type | Description |
|---|---|---|
inbuf | const char * | Input binary data. |
nread | size_t | Number of bytes to encode. |
outbuf | char * | Output buffer; must be at least nread * 4 / 3 + 4 bytes. |
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() calls to flush the final block.
Returns
Number of characters written.
Reimplements
Parameters
| Parameter | Type | Description |
|---|---|---|
outbuf | char * | Output buffer; must be at least 5 bytes. |
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
| Parameter | Type | Description |
|---|---|---|
lineLength | int | Characters per line; use 0 to disable. |
