37 std::string
fmt_uint(uint64_t val, uint8_t width = 0,
char fill =
'0');
55 std::string
fmt_filesize(uint64_t size,
bool simplify =
true,
int precision = 1);
88 std::string
fmt_timestamp(uint64_t second,
bool local,
const std::string &fmt);
126 std::string
to_hex(
const uint8_t *data,
size_t len,
bool upper =
true,
char separator =
' ');
135 std::string
to_hex(uint8_t value,
bool upper =
true,
const std::string &prefix =
"");
144 std::string
to_hex(uint16_t value,
bool upper =
true,
const std::string &prefix =
"");
153 std::string
to_hex(uint32_t value,
bool upper =
true,
const std::string &prefix =
"");
162 std::string
to_hex(uint64_t value,
bool upper =
true,
const std::string &prefix =
"");
171 std::string
to_bin(uint8_t value,
char separator =
',');
179 std::string
to_bin(uint16_t value,
char separator =
' ');
187 std::string
to_bin(uint32_t value,
char separator =
' ');
195 std::string
to_bin(uint64_t value,
char separator =
' ');
std::string fmt_timestamp_ms(uint64_t ms, bool local=true)
Format a timestamp to a human-readable string.
std::string fmt_timestamp_s(uint64_t second, bool local=true)
Format a timestamp to a human-readable string.
std::string fmt_uint(uint64_t val, uint8_t width=0, char fill='0')
Format uint64 value to a string with a given width and fill character.
std::string fmt_timestamp(uint64_t second, bool local, const std::string &fmt)
Format a timestamp to a human-readable string with a given format.
std::string fmt_timeduration_us(uint64_t nanoseconds)
Format a time duration to a human-readable string.
std::string fmt_filesize(uint64_t size, bool simplify=true, int precision=1)
Format a file size to a human-readable string with a given precision.
std::string fmt_double(double val, int precision=2)
Format double value to a string with a given precision.
std::string fmt_timeduration_s(uint64_t seconds)
Format a time duration to a human-readable string.
std::string fmt_timestamp_us(uint64_t us, bool local=true)
Format a timestamp to a human-readable string.
std::string to_bin(uint8_t value, char separator=',')
Format uint8_t value to a binary string.
std::string fmt_timeduration_ms(uint64_t microseconds)
Format a time duration to a human-readable string.
std::string to_hex(const uint8_t *data, size_t len, bool upper=true, char separator=' ')
Format data to a hex string.