blob: 8f4b9491e2211251caad84326dd035d34dcb78aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#ifndef GATS_DICTIONARY_H
#define GATS_DICTIONARY_H
#include "gats/object.h"
#include "gats/string.h"
#include <bu/hash.h>
namespace Gats
{
class List;
class Dictionary : public Gats::Object,
public Bu::Hash<Gats::String, Gats::Object *>
{
public:
Dictionary();
virtual ~Dictionary();
virtual Type getType() const { return typeDictionary; }
virtual void write( Bu::Stream &rOut ) const;
virtual void read( Bu::Stream &rIn, char cType );
void insert( const Bu::FString &sKey, const char *s );
void insert( const Bu::FString &sKey, const Bu::FString &s );
void insert( const Bu::FString &sKey, int32_t i );
void insert( const Bu::FString &sKey, int64_t i );
void insert( const Bu::FString &sKey, bool b );
void insert( const Bu::FString &sKey, double d );
using Bu::Hash<Gats::String, Gats::Object *>::insert;
bool getBool( const Bu::FString &sKey );
int64_t getInt( const Bu::FString &sKey );
double getFloat( const Bu::FString &sKey );
Bu::FString getStr( const Bu::FString &sKey );
Gats::List *getList( const Bu::FString &sKey );
Gats::Dictionary *getDict( const Bu::FString &sKey );
};
};
namespace Bu
{
template<>
uint32_t __calcHashCode<Gats::String>( const Gats::String &s );
};
#endif
|