aboutsummaryrefslogtreecommitdiff
path: root/c++-libbu++/src/tests/dump.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++-libbu++/src/tests/dump.cpp')
-rw-r--r--c++-libbu++/src/tests/dump.cpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/c++-libbu++/src/tests/dump.cpp b/c++-libbu++/src/tests/dump.cpp
index e0dcb52..f1950b2 100644
--- a/c++-libbu++/src/tests/dump.cpp
+++ b/c++-libbu++/src/tests/dump.cpp
@@ -1,3 +1,10 @@
1/*
2 * Copyright (C) 2007-2012 Xagasoft, All rights reserved.
3 *
4 * This file is part of the libgats library and is released under the
5 * terms of the license contained in the file LICENSE.
6 */
7
1#include <bu/sio.h> 8#include <bu/sio.h>
2#include <bu/file.h> 9#include <bu/file.h>
3#include <gats/gatsstream.h> 10#include <gats/gatsstream.h>
@@ -7,24 +14,24 @@ using namespace Bu;
7 14
8int main( int argc, char *argv[] ) 15int main( int argc, char *argv[] )
9{ 16{
10 File fIn( argv[1], File::Read ); 17 File fIn( argv[1], File::Read );
11 Gats::GatsStream gsIn( fIn ); 18 Gats::GatsStream gsIn( fIn );
12 19
13 for(;;) 20 for(;;)
14 { 21 {
15 sio << "Reading from file position: " << fIn.tell() << sio.nl; 22 sio << "Reading from file position: " << fIn.tell() << sio.nl;
16 Gats::Object *pObj = gsIn.readObject(); 23 Gats::Object *pObj = gsIn.readObject();
17 if( !pObj ) 24 if( !pObj )
18 { 25 {
19 if( gsIn.hasReadBuffer() ) 26 if( gsIn.hasReadBuffer() )
20 { 27 {
21 sio << "Premature end of stream detected, have " 28 sio << "Premature end of stream detected, have "
22 << gsIn.getReadBufferSize() << "b." << sio.nl; 29 << gsIn.getReadBufferSize() << "b." << sio.nl;
23 } 30 }
24 return 0; 31 return 0;
25 } 32 }
26 33
27 sio << *pObj << sio.nl; 34 sio << *pObj << sio.nl;
28 } 35 }
29} 36}
30 37