has a maximum of 512 chars of output
| 79 | |
| 80 | // has a maximum of 512 chars of output |
| 81 | std::string util_output_bytes(void* p, size_t n) |
| 82 | { |
| 83 | std::ostringstream ss; |
| 84 | ss.imbue(std::locale::classic()); |
| 85 | ss.setf(std::ios_base::hex, std::ios_base::basefield); |
| 86 | |
| 87 | for (size_t i = 0; i < n; i++) |
| 88 | { |
| 89 | ss.width(2); |
| 90 | ss << toupper(tss::util::char_to_size(((char*)p)[i])) << " "; |
| 91 | } |
| 92 | |
| 93 | std::string s = ss.str(); |
| 94 | if (s.length() > 512) |
| 95 | { |
| 96 | s = "truncated output: " + s; |
| 97 | s.resize(512); |
| 98 | } |
| 99 | |
| 100 | return s; |
| 101 | } |
| 102 | |
| 103 | iCodeConverter* iCodeConverter::GetInstance() |
| 104 | { |
no test coverage detected