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