aboutsummaryrefslogtreecommitdiff
path: root/c++-libbu++/src/dictionary.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c++-libbu++/src/dictionary.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/c++-libbu++/src/dictionary.cpp b/c++-libbu++/src/dictionary.cpp
index 5ed3834..00d06f7 100644
--- a/c++-libbu++/src/dictionary.cpp
+++ b/c++-libbu++/src/dictionary.cpp
@@ -12,6 +12,7 @@
12#include "gats/float.h" 12#include "gats/float.h"
13#include "gats/string.h" 13#include "gats/string.h"
14#include "gats/list.h" 14#include "gats/list.h"
15#include "gats/null.h"
15 16
16#include <bu/formatter.h> 17#include <bu/formatter.h>
17 18
@@ -249,6 +250,22 @@ Gats::Dictionary *Gats::Dictionary::insertDict( const Bu::String &sKey )
249 return pDict; 250 return pDict;
250} 251}
251 252
253void Gats::Dictionary::insertNull( const Bu::String &sKey )
254{
255 Bu::Hash<Gats::String, Gats::Object *>::insert(
256 sKey,
257 new Gats::Null()
258 );
259}
260
261bool Gats::Dictionary::isNull( const Bu::String &sKey )
262{
263 Gats::Object *pObj = get( sKey );
264 if( pObj->getType() == Gats::typeNull )
265 return true;
266 return false;
267}
268
252bool Gats::Dictionary::getBool( const Bu::String &sKey ) 269bool Gats::Dictionary::getBool( const Bu::String &sKey )
253{ 270{
254 Gats::Boolean *pOb = dynamic_cast<Gats::Boolean *>( get( sKey ) ); 271 Gats::Boolean *pOb = dynamic_cast<Gats::Boolean *>( get( sKey ) );
@@ -309,6 +326,14 @@ Gats::Dictionary *Gats::Dictionary::getDict( const Bu::String &sKey )
309 return pOb; 326 return pOb;
310} 327}
311 328
329bool Gats::Dictionary::isNull( const Bu::String &sKey ) const
330{
331 Gats::Object *pObj = get( sKey );
332 if( pObj->getType() == Gats::typeNull )
333 return true;
334 return false;
335}
336
312bool Gats::Dictionary::getBool( const Bu::String &sKey ) const 337bool Gats::Dictionary::getBool( const Bu::String &sKey ) const
313{ 338{
314 Gats::Boolean *pOb = dynamic_cast<Gats::Boolean *>( get( sKey ) ); 339 Gats::Boolean *pOb = dynamic_cast<Gats::Boolean *>( get( sKey ) );