From e1855a6ed118eccf93950c9821b75ca53646d774 Mon Sep 17 00:00:00 2001 From: Mike Buland <eichlan@xagasoft.com> Date: Mon, 11 Jun 2012 15:08:36 +0000 Subject: GatsCon can display nulls now. --- python/test.py | 3 +++ src/gatscon/gatstotree.cpp | 8 ++++++++ src/gatscon/gatstotree.h | 1 + 3 files changed, 12 insertions(+) diff --git a/python/test.py b/python/test.py index a359893..0057fbf 100755 --- a/python/test.py +++ b/python/test.py @@ -8,3 +8,6 @@ print isinstance( 1, bool ) print isinstance( 1, int ) print gats.loads( gats.dumps( [0, 1, 2, 3, None, {'hi': None, 'bye': 1}] ) ) + +gats.dump( [0, 1, 2, 3, None, {'hi': None, 'bye': 1}], open('test.gats', 'w') ) +gats.dump( 'hello', open('test-str.gats', 'w') ) diff --git a/src/gatscon/gatstotree.cpp b/src/gatscon/gatstotree.cpp index d01e4b8..e388d5e 100644 --- a/src/gatscon/gatstotree.cpp +++ b/src/gatscon/gatstotree.cpp @@ -31,6 +31,10 @@ void gatsToTree( QTreeWidgetItem *p, Gats::Object *pObj ) case Gats::typeDictionary: gatsToTree( p, dynamic_cast<Gats::Dictionary *>( pObj ) ); break; + + case Gats::typeNull: + gatsToTree( p, dynamic_cast<Gats::Null *>( pObj ) ); + break; } } @@ -81,3 +85,7 @@ void gatsToTree( QTreeWidgetItem *p, Gats::Dictionary *pObj ) } } +void gatsToTree( QTreeWidgetItem *p, Gats::Null *pObj ) +{ + p->setText( 1, "null"); +} diff --git a/src/gatscon/gatstotree.h b/src/gatscon/gatstotree.h index 26fb76c..a803017 100644 --- a/src/gatscon/gatstotree.h +++ b/src/gatscon/gatstotree.h @@ -23,5 +23,6 @@ void gatsToTree( QTreeWidgetItem *p, Gats::Float *pObj ); void gatsToTree( QTreeWidgetItem *p, Gats::Boolean *pObj ); void gatsToTree( QTreeWidgetItem *p, Gats::List *pObj ); void gatsToTree( QTreeWidgetItem *p, Gats::Dictionary *pObj ); +void gatsToTree( QTreeWidgetItem *p, Gats::Null *pObj ); #endif -- cgit v1.2.3