/*
{
"name": "json″,
"array": [
{
"cpp": "jsoncpp"
},
{
"java": "jsoninjava"
},
{
"php": "support"
}
]
}
*/
// string, number, object, array, true, false, null
struct STJsonValue
{
int m_nType;
std::string m_strData; // 原始数据(暂时)
};
// string
struct STJsonString : public STJsonValue
{
std::string m_strString;
};
// number
struct STJsonNumber : public STJsonValue
{
double m_dNumber;
};
// number
struct STJsonBool : public STJsonValue
{
bool m_bBool; // true/false
};
// null
struct STJsonNull : public STJsonValue
{
// nothing
};
// object(对应一个std::map<std::string, STJsonValue*> )
struct STJsonObject : public STJsonValue
{
// std::map<std::string, STJsonValue*>
};
// array(对应一个std::vector<STJsonValue*> )
struct STJsonArray : public STJsonValue
{
// std::vector<STJsonValue*>
};
我的JSON解析库
最新推荐文章于 2024-05-26 09:00:00 发布