35enum JSONType { JSONType_Null, JSONType_String, JSONType_Bool, JSONType_Number, JSONType_Array, JSONType_Object };
43 JSONValue(
const wchar_t *m_char_value);
44 JSONValue(
const std::wstring &m_string_value);
45 JSONValue(
bool m_bool_value);
46 JSONValue(
double m_number_value);
47 JSONValue(
int m_integer_value);
48 JSONValue(
const JSONArray &m_array_value);
49 JSONValue(
const JSONObject &m_object_value);
50 JSONValue(
const JSONValue &m_source);
54 bool IsString()
const;
56 bool IsNumber()
const;
58 bool IsObject()
const;
60 const std::wstring &AsString()
const;
62 double AsNumber()
const;
63 const JSONArray &AsArray()
const;
64 const JSONObject &AsObject()
const;
66 std::size_t CountChildren()
const;
67 bool HasChild(std::size_t index)
const;
68 JSONValue *Child(std::size_t index);
69 bool HasChild(
const wchar_t* name)
const;
70 JSONValue *Child(
const wchar_t* name);
71 std::vector<std::wstring> ObjectKeys()
const;
73 std::wstring Stringify(
bool const prettyprint =
false)
const;
75 static JSONValue *Parse(
const wchar_t **data);
78 static std::wstring StringifyString(
const std::wstring &str);
79 std::wstring StringifyImpl(
size_t const indentDepth)
const;
80 static std::wstring Indent(
size_t depth);
88 std::wstring *string_value;
89 JSONArray *array_value;
90 JSONObject *object_value;