diff options
author | Erwin Nindl <nine@wirdorange.org> | 2007-09-12 12:14:11 +0000 |
---|---|---|
committer | Erwin Nindl <nine@wirdorange.org> | 2007-09-12 12:14:11 +0000 |
commit | e340011d211618884ab85e1245c4b2f2e175c48e (patch) | |
tree | 91cb6957c89e2b6188e8f140d41409569c7cc187 /buffer.cpp | |
parent | overloaded std::ostream& operator<< for Buffer (diff) |
removed overloaded std::ostream& << operator because of problems with stdc++ library
Diffstat (limited to 'buffer.cpp')
-rw-r--r-- | buffer.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -30,8 +30,8 @@ #include <stdexcept> #include <string> -#include <iostream> #include <cstdio> +#include <iostream> #include "datatypes.h" #include "buffer.h" @@ -165,15 +165,13 @@ Buffer::operator u_int8_t*() // just for write/read tun return buf_; } -std::ostream& operator<<(std::ostream& output, const Buffer &src) +void Buffer::printHexDump() const { - char buf[10]; + char text[10]; - for( u_int32_t index = 0; index < src.getLength(); index++ ) + for( u_int32_t index = 0; index < length_; index++ ) { - std::sprintf(buf, "%#x", src[index]); - output << buf << " "; + std::sprintf(text, "%#x", buf_[index]); + std::cout << text << " "; } - - return output; } |