aboutsummaryrefslogtreecommitdiff
path: root/src/list.h
blob: 5c50faed7ab0764db0320f216a2689fdf408ce91 (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
34
35
36
37
38
39
40
41
#ifndef GATS_LIST_H
#define GATS_LIST_H

#include "gats/object.h"
#include <bu/list.h>
#include <bu/string.h>

namespace Gats
{
	class List : public Gats::Object, public Bu::List<Gats::Object *>
	{
	public:
		List();
		virtual ~List();

		virtual Type getType() const { return typeList; }

		virtual void write( Bu::Stream &rOut ) const;
		virtual void read( Bu::Stream &rIn, char cType );

		void append( const char *s );
		void append( const Bu::String &s );
		void append( int32_t i );
		void append( int64_t i );
		void append( bool b );
		void append( double d );
		using Bu::List<Gats::Object *>::append;
		
		void prepend( const char *s );
		void prepend( const Bu::String &s );
		void prepend( int32_t i );
		void prepend( int64_t i );
		void prepend( bool b );
		void prepend( double d );
		using Bu::List<Gats::Object *>::prepend;
	};
};

Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::List &l );

#endif