aboutsummaryrefslogtreecommitdiff
path: root/c++-qt/src/object.h
diff options
context:
space:
mode:
Diffstat (limited to 'c++-qt/src/object.h')
-rw-r--r--c++-qt/src/object.h83
1 files changed, 45 insertions, 38 deletions
diff --git a/c++-qt/src/object.h b/c++-qt/src/object.h
index 008ebef..7e12b87 100644
--- a/c++-qt/src/object.h
+++ b/c++-qt/src/object.h
@@ -1,3 +1,10 @@
1/*
2 * Copyright (C) 2007-2012 Xagasoft, All rights reserved.
3 *
4 * This file is part of the libgats library and is released under the
5 * terms of the license contained in the file LICENSE.
6 */
7
1#ifndef GATS_OBJECT_H 8#ifndef GATS_OBJECT_H
2#define GATS_OBJECT_H 9#define GATS_OBJECT_H
3 10
@@ -8,44 +15,44 @@ class QIODevice;
8 15
9namespace Gats 16namespace Gats
10{ 17{
11 enum Type 18 enum Type
12 { 19 {
13 typeDictionary, 20 typeDictionary,
14 typeList, 21 typeList,
15 typeString, 22 typeString,
16 typeInteger, 23 typeInteger,
17 typeFloat, 24 typeFloat,
18 typeBoolean, 25 typeBoolean,
19 typeNull 26 typeNull
20 }; 27 };
21 28
22 /** 29 /**
23 * The baseclass for every type that can be stored in a packet. 30 * The baseclass for every type that can be stored in a packet.
24 */ 31 */
25 class Object : public QObject 32 class Object : public QObject
26 { 33 {
27 Q_OBJECT; 34 Q_OBJECT;
28 public: 35 public:
29 Object(); 36 Object();
30 virtual ~Object(); 37 virtual ~Object();
31 38
32 virtual Object *clone() const=0; 39 virtual Object *clone() const=0;
33 40
34 virtual Type getType() const =0; 41 virtual Type getType() const =0;
35 42
36 virtual void write( QIODevice &rOut ) const=0; 43 virtual void write( QIODevice &rOut ) const=0;
37 virtual void read( QIODevice &rIn, char cType )=0; 44 virtual void read( QIODevice &rIn, char cType )=0;
38 45
39 static Object *read( QIODevice &rIn ); 46 static Object *read( QIODevice &rIn );
40// static Object *strToGats( const &sStr ); 47// static Object *strToGats( const &sStr );
41 48
42 private: 49 private:
43// static Object *strToGats( QByteArray::const_iterator &i ); 50// static Object *strToGats( QByteArray::const_iterator &i );
44// static QByteArray token( QByteArray::const_iterator &i ); 51// static QByteArray token( QByteArray::const_iterator &i );
45// static void skipWs( QByteArray::const_iterator &i ); 52// static void skipWs( QByteArray::const_iterator &i );
46 }; 53 };
47 54
48 const char *typeToStr( Type t ); 55 const char *typeToStr( Type t );
49}; 56};
50 57
51//Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Object &obj ); 58//Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Object &obj );