Formats a byte as "%02X".
| 3468 | |
| 3469 | // Formats a byte as "%02X". |
| 3470 | std::string String::FormatByte(unsigned char value) { |
| 3471 | std::stringstream ss; |
| 3472 | ss << std::setfill('0') << std::setw(2) << std::hex << std::uppercase |
| 3473 | << static_cast<unsigned int>(value); |
| 3474 | return ss.str(); |
| 3475 | } |
| 3476 | |
| 3477 | // Converts the buffer in a stringstream to an std::string, converting NUL |
| 3478 | // bytes to "\\0" along the way. |
nothing calls this directly
no outgoing calls
no test coverage detected