hex::Encoder
Encoder
#include <icy/hex.h>struct EncoderDefined in src/base/include/icy/hex.h:34
Inherits:
Encoder
Hex encoder.
List of all members
| Name | Kind | Owner |
|---|---|---|
_linePos | variable | Declared here |
_lineLength | variable | Declared here |
_uppercase | variable | Declared here |
Encoder | function | Declared here |
encode | function | Declared here |
finalize | function | Declared here |
setUppercase | 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 |
|---|---|---|
int | _linePos | |
int | _lineLength | |
int | _uppercase |
_linePos
int _linePosDefined in src/base/include/icy/hex.h:83
_lineLength
int _lineLengthDefined in src/base/include/icy/hex.h:84
_uppercase
int _uppercaseDefined in src/base/include/icy/hex.h:85
Public Methods
| Return | Name | Description |
|---|---|---|
Encoder inline | ||
ssize_t | encode virtual inline override | Encodes binary input as lowercase hex characters, optionally inserting newlines every _lineLength output characters. |
ssize_t | finalize virtual inline override | No-op finalizer; hex encoding has no pending state. |
void | setUppercase inline | Controls whether encoded output uses uppercase hex digits (A-F) or lowercase (a-f). |
void | setLineLength inline | Sets the maximum number of output characters per line before a newline is inserted. Set to 0 to disable line wrapping. |
Encoder
inline
inline Encoder()Defined in src/base/include/icy/hex.h:36
encode
virtual inline override
virtual inline ssize_t encode(const char * inbuf, size_t nread, char * outbuf) overrideDefined in src/base/include/icy/hex.h:49
Encodes binary input as lowercase hex characters, optionally inserting newlines every _lineLength output characters.
Parameters
inbufInput buffer to encode.nreadNumber of bytes to read from inbuf.outbufDestination buffer; must have capacity >= nread * 2 + nread/_lineLength + 1.
Returns
Number of bytes written to outbuf.
Reimplements
finalize
virtual inline override
virtual inline ssize_t finalize(char *) overrideDefined in src/base/include/icy/hex.h:72
No-op finalizer; hex encoding has no pending state.
Returns
Always 0.
Reimplements
setUppercase
inline
inline void setUppercase(bool flag)Defined in src/base/include/icy/hex.h:76
Controls whether encoded output uses uppercase hex digits (A-F) or lowercase (a-f).
Parameters
flagtrue for uppercase, false for lowercase.
setLineLength
inline
inline void setLineLength(int lineLength)Defined in src/base/include/icy/hex.h:81
Sets the maximum number of output characters per line before a newline is inserted. Set to 0 to disable line wrapping.
Parameters
lineLengthCharacters per line.
