diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-11-09 17:20:11 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-11-09 17:20:11 +0000 |
commit | d534a56d95bca7bdd812be024d9eacba4734e2b7 (patch) | |
tree | f9b98ee2b80e645a7b54e7934882be6c9f73c165 /c++-qt/src/object.h | |
parent | 61ccc86fdf06f12cb72a8b7e65286f812cf62154 (diff) | |
download | libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.tar.gz libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.tar.bz2 libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.tar.xz libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.zip |
Many changes: tabconv'd the C++ code, added a license, BSD, and docs.
Diffstat (limited to 'c++-qt/src/object.h')
-rw-r--r-- | c++-qt/src/object.h | 83 |
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 | ||
9 | namespace Gats | 16 | namespace 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 ); |