From 8e0f468e79263dc7f9a6364ca1a26036906642bc Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 5 Jun 2017 14:32:08 -0700 Subject: 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. --- src/unstable/json.cpp | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ src/unstable/json.h | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 src/unstable/json.cpp create mode 100644 src/unstable/json.h (limited to 'src') 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 @@ +#include "bu/json.h" + +Bu::Json::Base::Base() +{ +} + +Bu::Json::Base::~Base() +{ +} + +Bu::Json::Object::Object() +{ +} + +Bu::Json::Object::~Object() +{ +} + +Bu::Json::Type Bu::Json::Object::getType() +{ + return tObject; +} + +Bu::Json::Array::Array() +{ +} + +Bu::Json::Array::~Array() +{ +} + +Bu::Json::Type Bu::Json::Array::getType() +{ + return tArray; +} + +Bu::Json::String::String() +{ +} + +Bu::Json::String::~String() +{ +} + +Bu::Json::Type Bu::Json::String::getType() +{ + return tString; +} + +Bu::Json::Number::Number() +{ +} + +Bu::Json::Number::~Number() +{ +} + +Bu::Json::Type Bu::Json::Number::getType() +{ + return tNumber; +} + +Bu::Json::Boolean::Boolean() +{ +} + +Bu::Json::Boolean::~Boolean() +{ +} + +Bu::Json::Type Bu::Json::Boolean::getType() +{ + return tBoolean; +} + +Bu::Json::Null::Null() +{ +} + +Bu::Json::Null::~Null() +{ +} + +Bu::Json::Type Bu::Json::Null::getType() +{ + return tNull; +} 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 @@ +#ifndef BU_JSON_H +#define BU_JSON_H + +namespace Bu +{ + class Json + { + public: + Json(); + virtual ~Json(); + + public: + enum Type + { + tObject, + tArray, + tString, + tNumber, + tBoolean, + tNull + }; + + class Base + { + public: + Base(); + virtual ~Base(); + + virtual Type getType()=0; + }; + + class Object : public Base + { + public: + Object(); + virtual ~Object(); + + virtual Type getType(); + }; + + class Array : public Base + { + public: + Array(); + virtual ~Array(); + + virtual Type getType(); + }; + + class String : public Base + { + public: + String(); + virtual ~String(); + + virtual Type getType(); + }; + + class Number : public Base + { + public: + Number(); + virtual ~Number(); + + virtual Type getType(); + }; + + class Boolean : public Base + { + public: + Boolean(); + virtual ~Boolean(); + + virtual Type getType(); + }; + + class Null : public Base + { + public: + Null(); + virtual ~Null(); + + virtual Type getType(); + }; + + private: + }; +}; + +#endif -- cgit v1.2.3