Prints a segment of bytes in the given object.
| 8610 | |
| 8611 | // Prints a segment of bytes in the given object. |
| 8612 | void 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. |
| 8631 | void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count, |
no outgoing calls
no test coverage detected