aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <mbuland@penny-arcade.com>2017-06-05 14:32:08 -0700
committerMike Buland <mbuland@penny-arcade.com>2017-06-05 14:32:08 -0700
commit8e0f468e79263dc7f9a6364ca1a26036906642bc (patch)
tree7acc4a4e659ae5e429452f2c8f18ddc74a41dba9
parent863d9bca2b58d6de22dc2d23379a8c7a5fd755f4 (diff)
downloadlibbu++-8e0f468e79263dc7f9a6364ca1a26036906642bc.tar.gz
libbu++-8e0f468e79263dc7f9a6364ca1a26036906642bc.tar.bz2
libbu++-8e0f468e79263dc7f9a6364ca1a26036906642bc.tar.xz
libbu++-8e0f468e79263dc7f9a6364ca1a26036906642bc.zip
Json?
I'm honestly not sure what kind of interface I want here, or how to organize it. It may just be better to expand the whole thing, spread it out some.
-rw-r--r--src/unstable/json.cpp87
-rw-r--r--src/unstable/json.h90
2 files changed, 177 insertions, 0 deletions
diff --git a/src/unstable/json.cpp b/src/unstable/json.cpp
new file mode 100644
index 0000000..0769836
--- /dev/null
+++ b/src/unstable/json.cpp
@@ -0,0 +1,87 @@
1#include "bu/json.h"
2
3Bu::Json::Base::Base()
4{
5}
6
7Bu::Json::Base::~Base()
8{
9}
10
11Bu::Json::Object::Object()
12{
13}
14
15Bu::Json::Object::~Object()
16{
17}
18
19Bu::Json::Type Bu::Json::Object::getType()
20{
21 return tObject;
22}
23
24Bu::Json::Array::Array()
25{
26}
27
28Bu::Json::Array::~Array()
29{
30}
31
32Bu::Json::Type Bu::Json::Array::getType()
33{
34 return tArray;
35}
36
37Bu::Json::String::String()
38{
39}
40
41Bu::Json::String::~String()
42{
43}
44
45Bu::Json::Type Bu::Json::String::getType()
46{
47 return tString;
48}
49
50Bu::Json::Number::Number()
51{
52}
53
54Bu::Json::Number::~Number()
55{
56}
57
58Bu::Json::Type Bu::Json::Number::getType()
59{
60 return tNumber;
61}
62
63Bu::Json::Boolean::Boolean()
64{
65}
66
67Bu::Json::Boolean::~Boolean()
68{
69}
70
71Bu::Json::Type Bu::Json::Boolean::getType()
72{
73 return tBoolean;
74}
75
76Bu::Json::Null::Null()
77{
78}
79
80Bu::Json::Null::~Null()
81{
82}
83
84Bu::Json::Type Bu::Json::Null::getType()
85{
86 return tNull;
87}
diff --git a/src/unstable/json.h b/src/unstable/json.h
new file mode 100644
index 0000000..660d1c6
--- /dev/null
+++ b/src/unstable/json.h
@@ -0,0 +1,90 @@
1#ifndef BU_JSON_H
2#define BU_JSON_H
3
4namespace Bu
5{
6 class Json
7 {
8 public:
9 Json();
10 virtual ~Json();
11
12 public:
13 enum Type
14 {
15 tObject,
16 tArray,
17 tString,
18 tNumber,
19 tBoolean,
20 tNull
21 };
22
23 class Base
24 {
25 public:
26 Base();
27 virtual ~Base();
28
29 virtual Type getType()=0;
30 };
31
32 class Object : public Base
33 {
34 public:
35 Object();
36 virtual ~Object();
37
38 virtual Type getType();
39 };
40
41 class Array : public Base
42 {
43 public:
44 Array();
45 virtual ~Array();
46
47 virtual Type getType();
48 };
49
50 class String : public Base
51 {
52 public:
53 String();
54 virtual ~String();
55
56 virtual Type getType();
57 };
58
59 class Number : public Base
60 {
61 public:
62 Number();
63 virtual ~Number();
64
65 virtual Type getType();
66 };
67
68 class Boolean : public Base
69 {
70 public:
71 Boolean();
72 virtual ~Boolean();
73
74 virtual Type getType();
75 };
76
77 class Null : public Base
78 {
79 public:
80 Null();
81 virtual ~Null();
82
83 virtual Type getType();
84 };
85
86 private:
87 };
88};
89
90#endif