diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-01-12 17:00:34 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-01-12 17:00:34 +0000 |
commit | 4a6e25854a3b70c8d7a526a22a78760b97118669 (patch) | |
tree | 742955254ba5f3b66266a1aded02ea80e5fc38a4 /src/tests | |
parent | 192cc37d6fa002446012855c24eca0a37e1afd7e (diff) | |
download | libgats-4a6e25854a3b70c8d7a526a22a78760b97118669.tar.gz libgats-4a6e25854a3b70c8d7a526a22a78760b97118669.tar.bz2 libgats-4a6e25854a3b70c8d7a526a22a78760b97118669.tar.xz libgats-4a6e25854a3b70c8d7a526a22a78760b97118669.zip |
Hey, documentation! That's novel.
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/dump.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
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 @@ | |||
1 | #include <bu/sio.h> | ||
2 | #include <bu/file.h> | ||
3 | #include <gats/gatsstream.h> | ||
4 | #include <gats/types.h> | ||
5 | |||
6 | using namespace Bu; | ||
7 | |||
8 | int main( int argc, char *argv[] ) | ||
9 | { | ||
10 | File fIn( argv[1], File::Read ); | ||
11 | Gats::GatsStream gsIn( fIn ); | ||
12 | |||
13 | for(;;) | ||
14 | { | ||
15 | sio << "Reading from file position: " << fIn.tell() << sio.nl; | ||
16 | Gats::Object *pObj = gsIn.readObject(); | ||
17 | if( !pObj ) | ||
18 | { | ||
19 | if( gsIn.hasReadBuffer() ) | ||
20 | { | ||
21 | sio << "Premature end of stream detected, have " | ||
22 | << gsIn.getReadBufferSize() << "b." << sio.nl; | ||
23 | } | ||
24 | return 0; | ||
25 | } | ||
26 | |||
27 | sio << *pObj << sio.nl; | ||
28 | } | ||
29 | } | ||
30 | |||