diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-06-03 12:25:57 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-06-03 12:46:12 (GMT) |
commit | 21fda3308975201eeebeacd98e2b587ef4448862 (patch) | |
tree | e8aebe473a636cf5a312814d4054d8af0d9ad6a6 /QA | |
parent | 10334c139670861d4860da59ad837fc3fe6fd41e (diff) | |
download | swift-contrib-21fda3308975201eeebeacd98e2b587ef4448862.zip swift-contrib-21fda3308975201eeebeacd98e2b587ef4448862.tar.bz2 |
Limit the use of the SafeString type.
Diffstat (limited to 'QA')
-rw-r--r-- | QA/Checker/IO.cpp | 20 | ||||
-rw-r--r-- | QA/Checker/IO.h | 2 |
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); |