diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-05-03 20:39:27 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-05-05 19:43:14 (GMT) |
commit | 772b2ec0243d7b55d91e4027d828881d18093ed0 (patch) | |
tree | 83a58b2b97f3992165ee20c05e0630452eb50457 /QA | |
parent | 0b3db8fd68abee7269d5a38aabd8a816e099eae5 (diff) | |
download | swift-772b2ec0243d7b55d91e4027d828881d18093ed0.zip swift-772b2ec0243d7b55d91e4027d828881d18093ed0.tar.bz2 |
Replace ByteArray by typedef.
Diffstat (limited to 'QA')
-rw-r--r-- | QA/Checker/IO.cpp | 23 | ||||
-rw-r--r-- | QA/Checker/IO.h | 11 | ||||
-rw-r--r-- | QA/Checker/SConscript | 2 |
3 files changed, 35 insertions, 1 deletions
diff --git a/QA/Checker/IO.cpp b/QA/Checker/IO.cpp new file mode 100644 index 0000000..4945791 --- /dev/null +++ b/QA/Checker/IO.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2010 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#include <QA/Checker/IO.h> + +#include <iostream> + +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 << " "; + } + } + os << std::endl; + os.flags(oldFlags); + return os; +} diff --git a/QA/Checker/IO.h b/QA/Checker/IO.h new file mode 100644 index 0000000..5eb61d8 --- /dev/null +++ b/QA/Checker/IO.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2010 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include <Swiften/Base/ByteArray.h> + +std::ostream& operator<<(std::ostream& os, const Swift::ByteArray& s); diff --git a/QA/Checker/SConscript b/QA/Checker/SConscript index 0456b93..96479db 100644 --- a/QA/Checker/SConscript +++ b/QA/Checker/SConscript @@ -11,4 +11,4 @@ if env["TEST"] : if env["SCONS_STAGE"] == "build" : checker_env = env.Clone() checker_env.MergeFlags(env["CPPUNIT_FLAGS"]) - checker_env.Library("Checker", "checker.cpp") + checker_env.Library("Checker", ["checker.cpp", "IO.cpp"]) |