From 74dd68ad611d15abf16a65c36a7cfd3f4492930a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 9 Nov 2012 16:25:22 +0000 Subject: Made the repo less libbu++-centric. --- c++-libbu++/src/tests/dump.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 c++-libbu++/src/tests/dump.cpp (limited to 'c++-libbu++/src/tests/dump.cpp') diff --git a/c++-libbu++/src/tests/dump.cpp b/c++-libbu++/src/tests/dump.cpp new file mode 100644 index 0000000..e0dcb52 --- /dev/null +++ b/c++-libbu++/src/tests/dump.cpp @@ -0,0 +1,30 @@ +#include +#include +#include +#include + +using namespace Bu; + +int main( int argc, char *argv[] ) +{ + File fIn( argv[1], File::Read ); + Gats::GatsStream gsIn( fIn ); + + for(;;) + { + sio << "Reading from file position: " << fIn.tell() << sio.nl; + Gats::Object *pObj = gsIn.readObject(); + if( !pObj ) + { + if( gsIn.hasReadBuffer() ) + { + sio << "Premature end of stream detected, have " + << gsIn.getReadBufferSize() << "b." << sio.nl; + } + return 0; + } + + sio << *pObj << sio.nl; + } +} + -- cgit v1.2.3