#include <icy/hex.h>Inherits:
Encoder
Hex encoder.
| Return | Name | Description |
|---|---|---|
int | _linePos | |
int | _lineLength | |
int | _uppercase |
int _linePosint _lineLengthint _uppercase| Return | Name | Description |
|---|---|---|
Encoder inline | ||
ssize_t | encode virtual inline | Encodes binary input as lowercase hex characters, optionally inserting newlines every _lineLength output characters. |
ssize_t | finalize virtual inline | 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. |
inline
inline Encoder()virtual inline
virtual inline ssize_t encode(const char * inbuf, size_t nread, char * outbuf)Encodes binary input as lowercase hex characters, optionally inserting newlines every _lineLength output characters.
inbuf Input buffer to encode.
nread Number of bytes to read from inbuf.
outbuf Destination buffer; must have capacity >= nread * 2 + nread/_lineLength + 1.
Number of bytes written to outbuf.
virtual inline
virtual inline ssize_t finalize(char *)No-op finalizer; hex encoding has no pending state.
Always 0.
inline
inline void setUppercase(bool flag)Controls whether encoded output uses uppercase hex digits (A-F) or lowercase (a-f).
flag true for uppercase, false for lowercase.inline
inline void setLineLength(int lineLength)Sets the maximum number of output characters per line before a newline is inserted. Set to 0 to disable line wrapping.
lineLength Characters per line.