#include <MIDI_Parsers/HexPuller.hpp>
Class that parses hexadecimal ASCII text to bytes.
For example, parses the string "7f A 123456"
to the bytes {0x7F, 0x0A, 0x12, 0x34, 0x56}
.
CharPuller | Class that supplies the ASCII characters to parse. |
Definition at line 25 of file HexPuller.hpp.
Public Member Functions | |
HexPuller (CharPuller &&puller) | |
bool | pull (uint8_t &output) |
Pull out a new byte. | |
Public Attributes | |
CharPuller | puller |
Static Private Member Functions | |
static uint8_t | hex2int (char hex) |
Convert a hexadecimal character to a 4-bit nibble. | |
Private Attributes | |
char | char1 = '\0' |
char | char2 = '\0' |
|
inline |
Definition at line 27 of file HexPuller.hpp.
|
inline |
Pull out a new byte.
Pulls characters from the CharPuller
until a hexadecimal number was found, decodes it, and returns it.
[out] | output | A new byte (if available). |
Definition at line 35 of file HexPuller.hpp.
|
inlinestaticprivate |
Convert a hexadecimal character to a 4-bit nibble.
Definition at line 61 of file HexPuller.hpp.
CharPuller puller |
Definition at line 66 of file HexPuller.hpp.
|
private |
Definition at line 69 of file HexPuller.hpp.
|
private |
Definition at line 70 of file HexPuller.hpp.