JSON-parsed storage form:
Small Description:
1.
{
"A": 1,
"B": "A ' g,f ' d[][{{}{} ' F",
"C": ["d,ed", 2,{"a": 1},[1,2],true,null],
"D": {"ACC": 1}
}
2.
struct Typevalue:public Value
{
int type;
Void *vpoint;///The pointer will be placed in a container in another class.
Class Valueobj:public Value
{
Public
Std::map<std::string,typevalue> Mypair;
Class Valuearr:public Value
{
Public
Std::vector<typevalue> VEC;
The 3.typevalue,valueobj,valuearr three are contained in each other, and typevalue knows what type of value is saved by its int type.
4. Separate processing according to commas, of course [] and {} Separate processing is not the same, {} is a key-value pair, [] not a key-value pair is a normal value +object+array
5. Operator overloading and type conversions are used
View Source Https://github.com/heyuanlong/jyjson
JSON parser implemented by C + +