diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-11-09 17:20:11 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-11-09 17:20:11 +0000 |
commit | d534a56d95bca7bdd812be024d9eacba4734e2b7 (patch) | |
tree | f9b98ee2b80e645a7b54e7934882be6c9f73c165 /c++-libbu++/src/tests/dump.cpp | |
parent | 61ccc86fdf06f12cb72a8b7e65286f812cf62154 (diff) | |
download | libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.tar.gz libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.tar.bz2 libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.tar.xz libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.zip |
Many changes: tabconv'd the C++ code, added a license, BSD, and docs.
Diffstat (limited to '')
-rw-r--r-- | c++-libbu++/src/tests/dump.cpp | 41 |
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 | ||
8 | int main( int argc, char *argv[] ) | 15 | int 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 | ||