MCPcopy Create free account
hub / github.com/BVLC/caffe / PrintByteSegmentInObjectTo

Function PrintByteSegmentInObjectTo

src/gtest/gtest-all.cpp:8612–8628  ·  view source on GitHub ↗

Prints a segment of bytes in the given object.

Source from the content-addressed store, hash-verified

8610
8611// Prints a segment of bytes in the given object.
8612void PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start,
8613 size_t count, ostream* os) {
8614 char text[5] = "";
8615 for (size_t i = 0; i != count; i++) {
8616 const size_t j = start + i;
8617 if (i != 0) {
8618 // Organizes the bytes into groups of 2 for easy parsing by
8619 // human.
8620 if ((j % 2) == 0)
8621 *os << ' ';
8622 else
8623 *os << '-';
8624 }
8625 snprintf(text, sizeof(text), "%02X", obj_bytes[j]);
8626 *os << text;
8627 }
8628}
8629
8630// Prints the bytes in the given value to the given ostream.
8631void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count,

Callers 1

PrintBytesInObjectToImplFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected