Decompose a sequence of bytes and store it in a variable.
Decompose a sequence of bytes and store it in a variable.
constuint8_t*expand_bytes( const uint8_t* b, const uint8_t* e, ...)
The expand_bytes() parameter is a combination of iterators of type uint8_t*. This specifies the next iterator after the beginning and end of the parsed target. If the parsing proceeds to the e position, nullptr is returned.
If there is no error in expansion, the next iterator to be read is returned.
The variable number parameters can be the following
Byte count
Data length
Explanation
uint8_t
1
uint16_t
2
Expand as a big-endian sequence
uint32_t
4
Expand as a big-endian sequence
uint8_t[N]
N
Fixed-length array of type uint8_t.
std::pair<char*,N>
N
Pairs of an array of type char*,uint8_t* and array length N can be generated with make_pair().