diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2010-08-14 07:12:29 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2010-08-14 07:12:29 +0000 |
| commit | 1b797548dff7e2475826ba29a71c3f496008988f (patch) | |
| tree | 2a81ee2e8fa2f17fd95410aabbf44533d35a727a /src/list.cpp | |
| download | libgats-1b797548dff7e2475826ba29a71c3f496008988f.tar.gz libgats-1b797548dff7e2475826ba29a71c3f496008988f.tar.bz2 libgats-1b797548dff7e2475826ba29a71c3f496008988f.tar.xz libgats-1b797548dff7e2475826ba29a71c3f496008988f.zip | |
libgats gets it's own repo. The rest of the history is in my misc repo.
Diffstat (limited to 'src/list.cpp')
| -rw-r--r-- | src/list.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/list.cpp b/src/list.cpp new file mode 100644 index 0000000..995a764 --- /dev/null +++ b/src/list.cpp | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | #include "gats/list.h" | ||
| 2 | |||
| 3 | #include <bu/stream.h> | ||
| 4 | |||
| 5 | Gats::List::List() | ||
| 6 | { | ||
| 7 | } | ||
| 8 | |||
| 9 | Gats::List::~List() | ||
| 10 | { | ||
| 11 | } | ||
| 12 | |||
| 13 | void Gats::List::write( Bu::Stream &rOut ) const | ||
| 14 | { | ||
| 15 | rOut.write("l", 1 ); | ||
| 16 | for( const_iterator i = begin(); i; i++ ) | ||
| 17 | { | ||
| 18 | (*i)->write( rOut ); | ||
| 19 | } | ||
| 20 | rOut.write("e", 1 ); | ||
| 21 | } | ||
| 22 | |||
| 23 | void Gats::List::read( Bu::Stream &rIn, char cType ) | ||
| 24 | { | ||
| 25 | for(;;) | ||
| 26 | { | ||
| 27 | Gats::Object *pObj = Gats::Object::read( rIn ); | ||
| 28 | if( pObj == NULL ) | ||
| 29 | break; | ||
| 30 | append( pObj ); | ||
| 31 | } | ||
| 32 | } | ||
| 33 | |||
