aboutsummaryrefslogtreecommitdiff
path: root/c++-qt/src/list.h
blob: 6e5ac565af1800843403ca2e428be130cf9246d8 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef GATS_LIST_H
#define GATS_LIST_H

#include "gats-qt/object.h"
#include <QList>

namespace Gats
{
	class Dictionary;

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

		virtual Object *clone() const;

		virtual Type getType() const { return typeList; }

		virtual void write( QIODevice &rOut ) const;
		virtual void read( QIODevice &rIn, char cType );

		void append( const char *s );
		void append( const QByteArray &s );
		void append( int32_t i );
		void append( int64_t i );
		void append( double d );
		using QList<Gats::Object *>::append;
		void appendStr( const QByteArray &s );
		void appendInt( int64_t i );
		void appendFloat( double d );
		void appendBool( bool b );
		void appendList( Gats::List *pL );
		void appendDict( Gats::Dictionary *pD );
		Gats::List *appendList();
		Gats::Dictionary *appendDict();
		
		void prepend( const char *s );
		void prepend( const QByteArray &s );
		void prepend( int32_t i );
		void prepend( int64_t i );
		void prepend( double d );
		using QList<Gats::Object *>::prepend;
		void prependStr( const QByteArray &s );
		void prependInt( int64_t i );
		void prependFloat( double d );
		void prependBool( bool b );
		void prependList( Gats::List *pL );
		void prependDict( Gats::Dictionary *pD );
		Gats::List *prependList();
		Gats::Dictionary *prependDict();
	};
};

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

#endif