diff options
Diffstat (limited to 'c++-qt/gats-qt/object.h')
| -rw-r--r--[l---------] | c++-qt/gats-qt/object.h | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/c++-qt/gats-qt/object.h b/c++-qt/gats-qt/object.h index 04b70ec..7e12b87 120000..100644 --- a/c++-qt/gats-qt/object.h +++ b/c++-qt/gats-qt/object.h | |||
| @@ -1 +1,61 @@ | |||
| 1 | ../src/object.h \ No newline at end of file | 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 | |||
| 8 | #ifndef GATS_OBJECT_H | ||
| 9 | #define GATS_OBJECT_H | ||
| 10 | |||
| 11 | #include <QObject> | ||
| 12 | #include <QByteArray> | ||
| 13 | |||
| 14 | class QIODevice; | ||
| 15 | |||
| 16 | namespace Gats | ||
| 17 | { | ||
| 18 | enum Type | ||
| 19 | { | ||
| 20 | typeDictionary, | ||
| 21 | typeList, | ||
| 22 | typeString, | ||
| 23 | typeInteger, | ||
| 24 | typeFloat, | ||
| 25 | typeBoolean, | ||
| 26 | typeNull | ||
| 27 | }; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * The baseclass for every type that can be stored in a packet. | ||
| 31 | */ | ||
| 32 | class Object : public QObject | ||
| 33 | { | ||
| 34 | Q_OBJECT; | ||
| 35 | public: | ||
| 36 | Object(); | ||
| 37 | virtual ~Object(); | ||
| 38 | |||
| 39 | virtual Object *clone() const=0; | ||
| 40 | |||
| 41 | virtual Type getType() const =0; | ||
| 42 | |||
| 43 | virtual void write( QIODevice &rOut ) const=0; | ||
| 44 | virtual void read( QIODevice &rIn, char cType )=0; | ||
| 45 | |||
| 46 | static Object *read( QIODevice &rIn ); | ||
| 47 | // static Object *strToGats( const &sStr ); | ||
| 48 | |||
| 49 | private: | ||
| 50 | // static Object *strToGats( QByteArray::const_iterator &i ); | ||
| 51 | // static QByteArray token( QByteArray::const_iterator &i ); | ||
| 52 | // static void skipWs( QByteArray::const_iterator &i ); | ||
| 53 | }; | ||
| 54 | |||
| 55 | const char *typeToStr( Type t ); | ||
| 56 | }; | ||
| 57 | |||
| 58 | //Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Object &obj ); | ||
| 59 | //Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Type &t ); | ||
| 60 | |||
| 61 | #endif | ||
