c++ - JsonCpp:如何将对象转换/序列化为 Json::Value
问题描述
是否可以Json::Value
在 jsonCpp 中转换/序列化对象?
例如:我有课
class MyClass
{
std::string str1;
std::string str2;
std::unordered_map<std::string, std::string> map1;
std::unordered_map<std::string, std::string> map2;
bool boo1;
void func1();
void func2();
}
MyClass myObject;
我想改变myObject
to Json::Value
,也许像
Json::Value myJson = JsonParse(myObject) //not a real code
解决方案
推荐阅读
- vba - Vba自动化单击此脚本中的“输入”按钮
- angular - 具有一对多关系的可观察数据服务
- javascript - event.stopPropagation 覆盖 event.target
- mysql - 在 bookshelf.js 中设置 value = value +1
- ruby-on-rails - Rails5 集成测试 assert_equal 与闪存消息
- python-3.x - 如何在pyspark函数中使用全局变量
- machine-learning - 动态环境的机器学习算法
- entity-framework-core - 用于记录跟踪的数据库设计
- html - 如何在css中的图像后添加段落
- python - 如何将 scipy.stats.describe 应用于每个组?