summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'QA/Checker')
-rw-r--r--QA/Checker/IO.cpp20
-rw-r--r--QA/Checker/IO.h2
2 files changed, 10 insertions, 12 deletions
diff --git a/QA/Checker/IO.cpp b/QA/Checker/IO.cpp
index 0e402f7..659e16e 100644
--- a/QA/Checker/IO.cpp
+++ b/QA/Checker/IO.cpp
@@ -12,9 +12,11 @@ std::ostream& operator<<(std::ostream& os, const Swift::ByteArray& s) {
std::ios::fmtflags oldFlags = os.flags();
os << std::hex;
for (Swift::ByteArray::const_iterator i = s.begin(); i != s.end(); ++i) {
- os << "0x" << static_cast<unsigned int>(static_cast<unsigned char>(*i));
- if (i + 1 < s.end()) {
- os << " ";
+ if (*i >= 32 && *i < 127) {
+ os << *i;
+ }
+ else {
+ os << "\\x" << static_cast<unsigned int>(static_cast<unsigned char>(*i));
}
}
os << std::endl;
@@ -26,9 +28,11 @@ std::ostream& operator<<(std::ostream& os, const Swift::SafeByteArray& s) {
std::ios::fmtflags oldFlags = os.flags();
os << std::hex;
for (Swift::SafeByteArray::const_iterator i = s.begin(); i != s.end(); ++i) {
- os << "0x" << static_cast<unsigned int>(static_cast<unsigned char>(*i));
- if (i + 1 < s.end()) {
- os << " ";
+ if (*i >= 32 && *i < 127) {
+ os << *i;
+ }
+ else {
+ os << "\\x" << static_cast<unsigned int>(static_cast<unsigned char>(*i));
}
}
os << std::endl;
@@ -36,7 +40,3 @@ std::ostream& operator<<(std::ostream& os, const Swift::SafeByteArray& s) {
return os;
}
-std::ostream& operator<<(std::ostream& os, const Swift::SafeString& s) {
- os << s.toString();
- return os;
-}
diff --git a/QA/Checker/IO.h b/QA/Checker/IO.h
index 79ec878..a369b56 100644
--- a/QA/Checker/IO.h
+++ b/QA/Checker/IO.h
@@ -8,8 +8,6 @@
#include <Swiften/Base/ByteArray.h>
#include <Swiften/Base/SafeByteArray.h>
-#include <Swiften/Base/SafeString.h>
std::ostream& operator<<(std::ostream& os, const Swift::ByteArray& s);
std::ostream& operator<<(std::ostream& os, const Swift::SafeByteArray& s);
-std::ostream& operator<<(std::ostream& os, const Swift::SafeString& s);