#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 Object *clone() const; virtual void write( Bu::Stream &rOut ) const; virtual void read( Bu::Stream &rIn, char cType ); void insert( const Bu::String &sKey, const char *s ); void insert( const Bu::String &sKey, const Bu::String &s ); void insert( const Bu::String &sKey, char i ); void insert( const Bu::String &sKey, unsigned char i ); void insert( const Bu::String &sKey, signed char i ); void insert( const Bu::String &sKey, unsigned short i ); void insert( const Bu::String &sKey, signed short i ); void insert( const Bu::String &sKey, unsigned int i ); void insert( const Bu::String &sKey, signed int i ); void insert( const Bu::String &sKey, unsigned long i ); void insert( const Bu::String &sKey, signed long i ); void insert( const Bu::String &sKey, unsigned long long i ); void insert( const Bu::String &sKey, signed long long i ); //void insert( const Bu::String &sKey, bool b ); void insert( const Bu::String &sKey, float d ); void insert( const Bu::String &sKey, double d ); using Bu::Hash::insert; void insertBool( const Bu::String &sKey, bool b ); void insertInt( const Bu::String &sKey, int64_t i ); void insertFloat( const Bu::String &sKey, double d ); void insertStr( const Bu::String &sKey, const Bu::String &s ); void insertList( const Bu::String &sKey, Gats::List *pL ); void insertDict( const Bu::String &sKey, Gats::Dictionary *pD ); Gats::List *insertList( const Bu::String &sKey ); Gats::Dictionary *insertDict( const Bu::String &sKey ); bool getBool( const Bu::String &sKey ); int64_t getInt( const Bu::String &sKey ); double getFloat( const Bu::String &sKey ); Bu::String getStr( const Bu::String &sKey ); Gats::List *getList( const Bu::String &sKey ); Gats::Dictionary *getDict( const Bu::String &sKey ); bool getBool( const Bu::String &sKey ) const; int64_t getInt( const Bu::String &sKey ) const; double getFloat( const Bu::String &sKey ) const; Bu::String getStr( const Bu::String &sKey ) const; Gats::List *getList( const Bu::String &sKey ) const; Gats::Dictionary *getDict( const Bu::String &sKey ) const; }; }; namespace Bu { template<> uint32_t __calcHashCode( const Gats::String &s ); }; Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Dictionary &d ); #endif