Helper class for binary driver: provides methods for handling binary data.
More...
#include <BinaryDriver.h>
Helper class for binary driver: provides methods for handling binary data.
◆ PushUint16()
Helper function to push a uint16 to a std::vector of bytes, as two consecutive bytes (either little-endian or big-endian according to littleEndian parameter)
- Parameters
-
| data | the vector to push data to |
| value | the value to push |
| littleEndian | push data in little-endian format if true (default), big-endian otherwise |
◆ ReadUint16()
Bounds-checked read of a 16-bit value from a byte vector.
- Parameters
-
| data | Input vector |
| index | Byte index to read |
| littleEndian | push data in little-endian format if true (default), big-endian otherwise |
- Returns
- data[index] if in bounds, or 0 if out of bounds
◆ ReadUint8()
Bounds-checked read of an 8-bit value from a byte vector.
- Parameters
-
| data | Input vector |
| index | Byte index to read |
- Returns
- data[index] if in bounds, or 0 if out of bounds
The documentation for this class was generated from the following files: