aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tests/json.cpp7
-rw-r--r--src/unstable/json.cpp6
-rw-r--r--src/unstable/json.h3
3 files changed, 16 insertions, 0 deletions
diff --git a/src/tests/json.cpp b/src/tests/json.cpp
index 7c1c119..d588a02 100644
--- a/src/tests/json.cpp
+++ b/src/tests/json.cpp
@@ -5,6 +5,13 @@
5 5
6int main( int argc, char *argv[] ) 6int main( int argc, char *argv[] )
7{ 7{
8 Bu::Json j("Hi there");
9 Bu::println( j.toString() );
10 return 0;
11}
12
13void hi()
14{
8 Bu::File fIn( "test1.json", Bu::File::Read ); 15 Bu::File fIn( "test1.json", Bu::File::Read );
9 Bu::Json ob( fIn ); 16 Bu::Json ob( fIn );
10 ob.write( Bu::sioRaw ); 17 ob.write( Bu::sioRaw );
diff --git a/src/unstable/json.cpp b/src/unstable/json.cpp
index d13f6e2..b22ca0d 100644
--- a/src/unstable/json.cpp
+++ b/src/unstable/json.cpp
@@ -19,6 +19,12 @@ Bu::Json::Json( const Bu::String &sValue ) :
19{ 19{
20} 20}
21 21
22Bu::Json::Json( const char *sValue ) :
23 eType( String ),
24 uDat( sValue )
25{
26}
27
22Bu::Json::Json( double dValue ) : 28Bu::Json::Json( double dValue ) :
23 eType( Number ), 29 eType( Number ),
24 uDat( dValue ) 30 uDat( dValue )
diff --git a/src/unstable/json.h b/src/unstable/json.h
index 5a59b7e..6042f7d 100644
--- a/src/unstable/json.h
+++ b/src/unstable/json.h
@@ -33,6 +33,7 @@ namespace Bu
33 public: 33 public:
34 Json(); 34 Json();
35 Json( const Bu::String &sValue ); 35 Json( const Bu::String &sValue );
36 Json( const char *sValue );
36 Json( double dValue ); 37 Json( double dValue );
37 Json( bool bValue ); 38 Json( bool bValue );
38 Json( Type eType ); 39 Json( Type eType );
@@ -83,6 +84,8 @@ namespace Bu
83 DatUnion() : pObject( NULL ) { } 84 DatUnion() : pObject( NULL ) { }
84 DatUnion( const Bu::String &sValue ) : 85 DatUnion( const Bu::String &sValue ) :
85 pString( new Bu::String( sValue ) ) { } 86 pString( new Bu::String( sValue ) ) { }
87 DatUnion( const char *sValue ) :
88 pString( new Bu::String( sValue ) ) { }
86 DatUnion( double dValue ) : dNumber( dValue ) { } 89 DatUnion( double dValue ) : dNumber( dValue ) { }
87 DatUnion( bool bValue ) : bBoolean( bValue ) { } 90 DatUnion( bool bValue ) : bBoolean( bValue ) { }
88 JsonHash *pObject; 91 JsonHash *pObject;