aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/json.h
diff options
context:
space:
mode:
authorMike Buland <mbuland@penny-arcade.com>2017-06-07 00:11:51 -0700
committerMike Buland <mbuland@penny-arcade.com>2017-06-07 00:11:51 -0700
commit2fc7fcd7161121ab48cda40687d7d152e03b3079 (patch)
tree2cfeff13b83605f9411798de34fffe6d0087c809 /src/unstable/json.h
parente98644cd777ddd4ae769da2d8bdcbc6fa8bbb30a (diff)
downloadlibbu++-2fc7fcd7161121ab48cda40687d7d152e03b3079.tar.gz
libbu++-2fc7fcd7161121ab48cda40687d7d152e03b3079.tar.bz2
libbu++-2fc7fcd7161121ab48cda40687d7d152e03b3079.tar.xz
libbu++-2fc7fcd7161121ab48cda40687d7d152e03b3079.zip
Changed interface slightly, it's easier to create json programmatically.
Diffstat (limited to 'src/unstable/json.h')
-rw-r--r--src/unstable/json.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/unstable/json.h b/src/unstable/json.h
index 2d1770d..76d96be 100644
--- a/src/unstable/json.h
+++ b/src/unstable/json.h
@@ -32,7 +32,10 @@ namespace Bu
32 32
33 public: 33 public:
34 Json(); 34 Json();
35 Json( const Bu::String &sJson ); 35 Json( const Bu::String &sValue );
36 Json( double dValue );
37 Json( bool bValue );
38 Json( Type eType );
36 Json( Bu::Stream &sInput ); 39 Json( Bu::Stream &sInput );
37 virtual ~Json(); 40 virtual ~Json();
38 41
@@ -49,6 +52,7 @@ namespace Bu
49 const_iterator end() const; 52 const_iterator end() const;
50 53
51 void parse( Bu::Stream &sInput ); 54 void parse( Bu::Stream &sInput );
55 void parse( const Bu::String &sInput );
52 void reset(); 56 void reset();
53 57
54 void write( Bu::Stream &sOutput ) const; 58 void write( Bu::Stream &sOutput ) const;
@@ -75,6 +79,10 @@ namespace Bu
75 union DatUnion 79 union DatUnion
76 { 80 {
77 DatUnion() : pObject( NULL ) { } 81 DatUnion() : pObject( NULL ) { }
82 DatUnion( const Bu::String &sValue ) :
83 pString( new Bu::String( sValue ) ) { }
84 DatUnion( double dValue ) : dNumber( dValue ) { }
85 DatUnion( bool bValue ) : bBoolean( bValue ) { }
78 JsonHash *pObject; 86 JsonHash *pObject;
79 JsonList *pArray; 87 JsonList *pArray;
80 Bu::String *pString; 88 Bu::String *pString;