diff options
author | lloyd <[email protected]> | 2010-01-21 18:40:09 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-01-21 18:40:09 +0000 |
commit | f2ce59496c23d4ff431a69aa4aedf2bf38d4230a (patch) | |
tree | 0b774f7cb199a13a9864cfe961adcc8af66c3103 /src/utils/debug.h | |
parent | 41bed2fa0c4d96faf805cd33850166972dcac114 (diff) |
Inline debug funcs to debug.h, make print_vec a template on the base type
Diffstat (limited to 'src/utils/debug.h')
-rw-r--r-- | src/utils/debug.h | 19 |
1 files changed, 15 insertions, 4 deletions
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()); + } } |