| 62 | static inline bool IsVisible(char c) { return (c >= 0x20 && c <= 0x7E); } |
| 63 | |
| 64 | static inline std::string FormatToString(uint32_t name, uint32_t max_shift) { |
| 65 | uint32_t shift = 0; |
| 66 | std::string result; |
| 67 | result.resize(max_shift); |
| 68 | char* rbuffer = reinterpret_cast<char*>(&(result[0])); |
| 69 | for (uint32_t i = 0; i < max_shift; i++) { |
| 70 | rbuffer[i] = '0'; |
| 71 | } |
| 72 | while (shift < max_shift) { |
| 73 | rbuffer[max_shift - shift - 1] = LABELS[name % 10]; |
| 74 | shift++; |
| 75 | name /= 10; |
| 76 | } |
| 77 | return result; |
| 78 | } |
| 79 | |
| 80 | static inline char ToHex(uint8_t i) { |
| 81 | char j = 0; |
no outgoing calls