From 4a6e25854a3b70c8d7a526a22a78760b97118669 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 12 Jan 2011 17:00:34 +0000 Subject: Hey, documentation! That's novel. --- src/tests/dump.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/tests/dump.cpp (limited to 'src') diff --git a/src/tests/dump.cpp b/src/tests/dump.cpp new file mode 100644 index 0000000..e0dcb52 --- /dev/null +++ b/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