diff options
Diffstat (limited to '')
| -rw-r--r-- | src/dictionary.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/dictionary.cpp b/src/dictionary.cpp index aaba7b8..9728804 100644 --- a/src/dictionary.cpp +++ b/src/dictionary.cpp | |||
| @@ -168,6 +168,63 @@ void Gats::Dictionary::insert( const Bu::String &sKey, const Bu::String &s ) | |||
| 168 | ); | 168 | ); |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | void Gats::Dictionary::insertBool( const Bu::String &sKey, bool b ) | ||
| 172 | { | ||
| 173 | Bu::Hash<Gats::String, Gats::Object *>::insert( | ||
| 174 | sKey, new Gats::Boolean( b ) | ||
| 175 | ); | ||
| 176 | } | ||
| 177 | |||
| 178 | void Gats::Dictionary::insertInt( const Bu::String &sKey, int64_t i ) | ||
| 179 | { | ||
| 180 | Bu::Hash<Gats::String, Gats::Object *>::insert( | ||
| 181 | sKey, new Gats::Integer( i ) | ||
| 182 | ); | ||
| 183 | } | ||
| 184 | |||
| 185 | void Gats::Dictionary::insertFloat( const Bu::String &sKey, double d ) | ||
| 186 | { | ||
| 187 | Bu::Hash<Gats::String, Gats::Object *>::insert( | ||
| 188 | sKey, new Gats::Float( d ) | ||
| 189 | ); | ||
| 190 | } | ||
| 191 | |||
| 192 | void Gats::Dictionary::insertStr( const Bu::String &sKey, const Bu::String &s ) | ||
| 193 | { | ||
| 194 | Bu::Hash<Gats::String, Gats::Object *>::insert( | ||
| 195 | sKey, new Gats::String( s ) | ||
| 196 | ); | ||
| 197 | } | ||
| 198 | |||
| 199 | void Gats::Dictionary::insertList( const Bu::String &sKey, Gats::List *pL ) | ||
| 200 | { | ||
| 201 | Bu::Hash<Gats::String, Gats::Object *>::insert( | ||
| 202 | sKey, pL | ||
| 203 | ); | ||
| 204 | } | ||
| 205 | |||
| 206 | void Gats::Dictionary::insertDict( const Bu::String &sKey, | ||
| 207 | Gats::Dictionary *pD ) | ||
| 208 | { | ||
| 209 | Bu::Hash<Gats::String, Gats::Object *>::insert( | ||
| 210 | sKey, pD | ||
| 211 | ); | ||
| 212 | } | ||
| 213 | |||
| 214 | Gats::List *Gats::Dictionary::insertList( const Bu::String &sKey ) | ||
| 215 | { | ||
| 216 | Gats::List *pLst = new Gats::List(); | ||
| 217 | insertList( sKey, pLst ); | ||
| 218 | return pLst; | ||
| 219 | } | ||
| 220 | |||
| 221 | Gats::Dictionary *Gats::Dictionary::insertDict( const Bu::String &sKey ) | ||
| 222 | { | ||
| 223 | Gats::Dictionary *pDict = new Gats::Dictionary(); | ||
| 224 | insertDict( sKey, pDict ); | ||
| 225 | return pDict; | ||
| 226 | } | ||
| 227 | |||
| 171 | bool Gats::Dictionary::getBool( const Bu::String &sKey ) | 228 | bool Gats::Dictionary::getBool( const Bu::String &sKey ) |
| 172 | { | 229 | { |
| 173 | Gats::Boolean *pOb = dynamic_cast<Gats::Boolean *>( get( sKey ) ); | 230 | Gats::Boolean *pOb = dynamic_cast<Gats::Boolean *>( get( sKey ) ); |
