aboutsummaryrefslogtreecommitdiff
path: root/src/list.cpp
blob: 995a76499e16585389606958a8f9adf56a95a0bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "gats/list.h"

#include <bu/stream.h>

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 );
	}
}