From 1b797548dff7e2475826ba29a71c3f496008988f Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 14 Aug 2010 07:12:29 +0000 Subject: libgats gets it's own repo. The rest of the history is in my misc repo. --- src/list.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/list.cpp (limited to 'src/list.cpp') 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 @@ +#include "gats/list.h" + +#include + +Gats::List::List() +{ +} + +Gats::List::~List() +{ +} + +void Gats::List::write( Bu::Stream &rOut ) const +{ + rOut.write("l", 1 ); + for( const_iterator i = begin(); i; i++ ) + { + (*i)->write( rOut ); + } + rOut.write("e", 1 ); +} + +void Gats::List::read( Bu::Stream &rIn, char cType ) +{ + for(;;) + { + Gats::Object *pObj = Gats::Object::read( rIn ); + if( pObj == NULL ) + break; + append( pObj ); + } +} + -- cgit v1.2.3