Class HexDump
Defined in File HexDump.h
Class Documentation
-
class HexDump
Utility class for generating hexadecimal dumps of memory.
Public Static Functions
-
static void Dump(char *dst, const uint8_t *buf, int len)
Generates a hexadecimal dump of a memory buffer into a character array.
Note
The dst buf needs to be large enough to store all the data. 16 bytes are converted into: “00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF | 0123456789ABCDEF\n” (70 bytes)
- Parameters:
dst – The destination character array to write the dump to.
buf – The buffer containing the data to dump.
len – The number of bytes to dump.
-
static std::string Dump(const void *buf, int len)
Generates a hexadecimal dump of a memory buffer into a string.
- Parameters:
buf – The buffer containing the data to dump.
len – The number of bytes to dump.
- Returns:
A string containing the hexadecimal dump.
-
static std::string Dump(const std::vector<uint8_t> &data)
Generates a hexadecimal dump of a vector of bytes into a string.
- Parameters:
data – The vector of bytes to dump.
- Returns:
A string containing the hexadecimal dump.
-
static void Print(const void *buf, int len)
Prints a hexadecimal dump of a memory buffer to the standard output.
- Parameters:
buf – The buffer containing the data to dump.
len – The number of bytes to dump.
-
static void Print(const std::vector<uint8_t> &data)
Prints a hexadecimal dump of a vector of bytes to the standard output.
- Parameters:
data – The vector of bytes to dump.
-
static void Dump(char *dst, const uint8_t *buf, int len)