MCPcopy Create free account
hub / github.com/comaps/comaps / FormatBytesFromBuffer

Function FormatBytesFromBuffer

libs/kml/kml_tests/serdes_tests.cpp:34–44  ·  view source on GitHub ↗

This function can be used to generate textual representation of vector like you see above.

Source from the content-addressed store, hash-verified

32{
33// This function can be used to generate textual representation of vector<uint8_t> like you see above.
34std::string FormatBytesFromBuffer(std::vector<uint8_t> const & buffer)
35{
36 std::stringstream ss;
37 for (size_t i = 1; i <= buffer.size(); i++)
38 {
39 ss << "0x" << NumToHex(buffer[i - 1]) << ", ";
40 if (i % 16 == 0)
41 ss << "\n";
42 }
43 return ss.str();
44}
45
46auto const kDefaultLang = localisation::kDefaultNameIndex;
47auto const kEnLang = localisation::kEnglishLanguageIndex;

Callers 1

UNIT_TESTFunction · 0.85

Calls 2

NumToHexFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected