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/Checker/IO.cpp | |
parent | 10334c139670861d4860da59ad837fc3fe6fd41e (diff) | |
download | swift-contrib-21fda3308975201eeebeacd98e2b587ef4448862.zip swift-contrib-21fda3308975201eeebeacd98e2b587ef4448862.tar.bz2 |
Limit the use of the SafeString type.
Diffstat (limited to 'QA/Checker/IO.cpp')
-rw-r--r-- | QA/Checker/IO.cpp | 20 |
1 files changed, 10 insertions, 10 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; -} |