+ printStringInHexadecimal() for debugging purpose

This commit is contained in:
kelson42 2010-05-16 12:52:14 +00:00
parent e6f0e38677
commit eb12d13f59
2 changed files with 13 additions and 0 deletions

View File

@ -66,3 +66,15 @@ std::string &removeAccents(std::string &text) {
unicodeAccentedString.toUTF8String(text);
return text;
}
void printStringInHexadecimal(const char *s) {
std::cout << std::showbase << std::hex;
for (char const* pc = s; *pc; ++pc) {
if (*pc & 0x80)
std::cout << (*pc & 0xff);
else
std::cout << *pc;
std::cout << ' ';
}
std::cout << std::endl;
}

View File

@ -95,3 +95,4 @@ private:
};
std::string &removeAccents(std::string &text);
void printStringInHexadecimal(const char *s);