From 1b797548dff7e2475826ba29a71c3f496008988f Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 14 Aug 2010 07:12:29 +0000 Subject: libgats gets it's own repo. The rest of the history is in my misc repo. --- src/dictionary.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/dictionary.h (limited to 'src/dictionary.h') diff --git a/src/dictionary.h b/src/dictionary.h new file mode 100644 index 0000000..3bcaec6 --- /dev/null +++ b/src/dictionary.h @@ -0,0 +1,44 @@ +#ifndef GATS_DICTIONARY_H +#define GATS_DICTIONARY_H + +#include "gats/object.h" +#include "gats/string.h" +#include + +namespace Gats +{ + class List; + + class Dictionary : public Gats::Object, + public Bu::Hash + { + 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, int64_t i ); + void insert( const Bu::FString &sKey, bool b ); + void insert( const Bu::FString &sKey, double d ); + void insert( const Bu::FString &sKey, const Bu::FString &s ); + using Bu::Hash::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( const Gats::String &s ); +}; + +#endif -- cgit v1.2.3