diff options
author | lloyd <[email protected]> | 2010-01-22 21:37:04 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-01-22 21:37:04 +0000 |
commit | ff0f319cebdee80d500a9a3efaa5710df5c55bd9 (patch) | |
tree | 72719ed9b6305c8d0358c5811922c44e3eafcf95 /src/utils | |
parent | 9c92ceb2b3bcc9537b4fe572f771d7bbaf8a478a (diff) | |
parent | d490659cd20c73f5e269b2e5f471512927df8ca7 (diff) |
propagate from branch 'net.randombit.botan' (head e088ea1566600cf598bcdc6840fcbbc662ab7393)
to branch 'net.randombit.botan.c++0x' (head 47ff08dfd9a19fad36bf4aa7fa10854fd9071e0a)
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/debug.cpp | 33 | ||||
-rw-r--r-- | src/utils/debug.h | 19 | ||||
-rw-r--r-- | src/utils/info.txt | 1 |
3 files changed, 15 insertions, 38 deletions
diff --git a/src/utils/debug.cpp b/src/utils/debug.cpp deleted file mode 100644 index 894418650..000000000 --- a/src/utils/debug.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/** -* Internal-use debugging functions for Botan -* (C) 2009 Jack Lloyd -* -* Distributed under the terms of the Botan license -*/ - -#include <botan/internal/debug.h> -#include <cstdio> - -namespace Botan { - -namespace Debug { - -void print_vec(const std::string& name, - const byte array[], - size_t array_len) - { - std::printf("%s = ", name.c_str()); - for(size_t i = 0; i != array_len; ++i) - std::printf("%02X", array[i]); - std::printf("\n"); - } - -void print_vec(const std::string& name, - const MemoryRegion<byte>& vec) - { - print_vec(name, &vec[0], vec.size()); - } - -} - -} diff --git a/src/utils/debug.h b/src/utils/debug.h index ee93d5ea0..c7f19c1b1 100644 --- a/src/utils/debug.h +++ b/src/utils/debug.h @@ -9,18 +9,29 @@ #define BOTAN_DEBUG_H__ #include <botan/secmem.h> +#include <iostream> namespace Botan { namespace Debug { +template<typename T> void print_vec(const std::string& name, - const byte array[], - size_t array_len); + const T array[], size_t array_len) + { + std::cout << name << " = "; -void print_vec(const std::string& name, - const MemoryRegion<byte>& vec); + for(size_t i = 0; i != array_len; ++i) + std::cout << std::hex << array[i]; + std::cout << std::endl; + } +template<typename T> +void print_vec(const std::string& name, + const MemoryRegion<T>& vec) + { + print_vec(name, &vec[0], vec.size()); + } } diff --git a/src/utils/info.txt b/src/utils/info.txt index f9d33d9d8..8f4ad5f0e 100644 --- a/src/utils/info.txt +++ b/src/utils/info.txt @@ -5,7 +5,6 @@ load_on always <source> charset.cpp cpuid.cpp -debug.cpp mlock.cpp parsing.cpp time.cpp |