Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Node;
- using Dict = std::map<std::string, Node>;
- using Array = std::vector<Node>;
- using NodeContainer = std::variant<std::nullptr_t, bool, int, double, std::string, Dict, Array>;
- // All methods should throw this error while JSON parsing
- class ParsingError : public std::runtime_error {
- public:
- using runtime_error::runtime_error;
- };
- class Node {
- public: // Constructors
- Node() = default;
- Node(std::nullptr_t /* value*/);
- Node(bool value);
- ...
- public: // Methods
- bool IsBool() const;
- const NodeContainer& AsPureNodeContainer() const;
- bool AsBool() const;
- ...
- public: // Operators
- friend bool operator==(const Node& left, const Node& right);
- friend bool operator!=(const Node& left, const Node& right);
- private: // Fields
- NodeContainer data_;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement