关于将json串用c++代码解释出来,并设置一个界面实现按钮之间的转换


students: [
'{{repeat(100)}}',
{
no: '2021{{integer(100,999)}}',
name: '{{random("张三", "李四", "王五")}}',
age: '{{integer(18, 22)}}',
gender: '{{gender()}}',
email: '{{email()}}',
phone: '{{phone()}}',
address: '{{city()}}',
clazz: '2021级{{integer(10,10)}}班',
courses: [
{
name: '数学',
score: '{{floating(10, 100, 2)}}'
},
{
name: '英语',
score: '{{floating(10, 100, 2)}}'
},
{
name: 'C++',
score: '{{floating(10, 100, 2)}}'
}
],
friends: [
'{{repeat(3,5)}}',
{
id: '{{index()}}',
name: '{{firstName()}}*{{surname()}}',
parents:[
'{{repeat(2)}}',
{

        }
    ]
    }
  ]    
}

]
}

用第三方库boost/property_tree,我之前的一份https://github.com/greatofdream/CAENReadout/blob/master/include/config.hxx#L27可供参考

https://github.com/cinemast/libjson-rpc-cpp
用的最多的,有例子程序,照着例子做就行了

C++实现Json解析详细教程
https://blog.csdn.net/qq_45662588/article/details/117962876