#include #include #include #include namespace TehJSON { class JSON { public: JSON(); JSON(const JSON& other) = default; ~JSON(); // Leaf methods template T& get(); template void set(T value); std::string leafType(); std::string getSerialized(); std::string _getSerialized(int currIndent); template static std::string serializeData(std::shared_ptr data); // Non leaf methods JSON& operator[](std::string name); size_t childCount(); // std::vector childNames(); private: bool isLeaf = false; // Leaf data fields std::shared_ptr data; std::string (*dataSerializer)(std::shared_ptr); // Not leaf data fields std::map children; }; }