#pragma once #include #include #include #include #include namespace Lgs { namespace Json { class ParseError : public Exception { public: ParseError(int lineNo, int column, const std::string& line); ~ParseError() throw() {} int lineNo_, column_; std::string line_; }; struct NullT {}; static const NullT Null; struct Array; struct Object; typedef boost::variant, boost::recursive_wrapper > Value; struct Array : public Lgs::Vector {}; struct Object : std::map {}; void parseJson(const std::string& str, Value& v); void parseJson(std::istream& istr, Value& v); void printJson(std::ostream& ostr, const Value& v); std::string printJson(const Value& v); } }