diff options
Diffstat (limited to 'c++-qt/src/dictionary.h')
-rw-r--r-- | c++-qt/src/dictionary.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/c++-qt/src/dictionary.h b/c++-qt/src/dictionary.h new file mode 100644 index 0000000..6db94b2 --- /dev/null +++ b/c++-qt/src/dictionary.h | |||
@@ -0,0 +1,68 @@ | |||
1 | #ifndef GATS_DICTIONARY_H | ||
2 | #define GATS_DICTIONARY_H | ||
3 | |||
4 | #include "gats-qt/object.h" | ||
5 | #include "gats-qt/string.h" | ||
6 | #include <QHash> | ||
7 | |||
8 | namespace Gats | ||
9 | { | ||
10 | class List; | ||
11 | |||
12 | class Dictionary : public Gats::Object, | ||
13 | public QHash<QByteArray, Gats::Object *> | ||
14 | { | ||
15 | Q_OBJECT; | ||
16 | public: | ||
17 | Dictionary(); | ||
18 | virtual ~Dictionary(); | ||
19 | |||
20 | virtual Type getType() const { return typeDictionary; } | ||
21 | virtual void write( QIODevice &rOut ) const; | ||
22 | virtual void read( QIODevice &rIn, char cType ); | ||
23 | |||
24 | void insert( const QByteArray &sKey, const char *s ); | ||
25 | void insert( const QByteArray &sKey, const QByteArray &s ); | ||
26 | void insert( const QByteArray &sKey, char i ); | ||
27 | void insert( const QByteArray &sKey, unsigned char i ); | ||
28 | void insert( const QByteArray &sKey, signed char i ); | ||
29 | void insert( const QByteArray &sKey, unsigned short i ); | ||
30 | void insert( const QByteArray &sKey, signed short i ); | ||
31 | void insert( const QByteArray &sKey, unsigned int i ); | ||
32 | void insert( const QByteArray &sKey, signed int i ); | ||
33 | void insert( const QByteArray &sKey, unsigned long i ); | ||
34 | void insert( const QByteArray &sKey, signed long i ); | ||
35 | void insert( const QByteArray &sKey, unsigned long long i ); | ||
36 | void insert( const QByteArray &sKey, signed long long i ); | ||
37 | //void insert( const QByteArray &sKey, bool b ); | ||
38 | void insert( const QByteArray &sKey, float d ); | ||
39 | void insert( const QByteArray &sKey, double d ); | ||
40 | using QHash<QByteArray, Gats::Object *>::insert; | ||
41 | void insertBool( const QByteArray &sKey, bool b ); | ||
42 | void insertInt( const QByteArray &sKey, int64_t i ); | ||
43 | void insertFloat( const QByteArray &sKey, double d ); | ||
44 | void insertStr( const QByteArray &sKey, const QByteArray &s ); | ||
45 | void insertList( const QByteArray &sKey, Gats::List *pL ); | ||
46 | void insertDict( const QByteArray &sKey, Gats::Dictionary *pD ); | ||
47 | Gats::List *insertList( const QByteArray &sKey ); | ||
48 | Gats::Dictionary *insertDict( const QByteArray &sKey ); | ||
49 | |||
50 | bool valueBool( const QByteArray &sKey ); | ||
51 | int64_t valueInt( const QByteArray &sKey ); | ||
52 | double valueFloat( const QByteArray &sKey ); | ||
53 | QByteArray valueStr( const QByteArray &sKey ); | ||
54 | Gats::List *valueList( const QByteArray &sKey ); | ||
55 | Gats::Dictionary *valueDict( const QByteArray &sKey ); | ||
56 | |||
57 | bool valueBool( const QByteArray &sKey ) const; | ||
58 | int64_t valueInt( const QByteArray &sKey ) const; | ||
59 | double valueFloat( const QByteArray &sKey ) const; | ||
60 | QByteArray valueStr( const QByteArray &sKey ) const; | ||
61 | Gats::List *valueList( const QByteArray &sKey ) const; | ||
62 | Gats::Dictionary *valueDict( const QByteArray &sKey ) const; | ||
63 | }; | ||
64 | }; | ||
65 | |||
66 | //Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Dictionary &d ); | ||
67 | |||
68 | #endif | ||