【文件属性】:
文件名称:json.hpp:使用Boost.Spirit的小型C ++ JSON解析库
文件大小:66KB
文件格式:ZIP
更新时间:2021-05-03 05:51:35
C++
json.hpp-使用Boost.Spirit的C ++ JSON解析
json.hpp是使用一个小(小于100行代码的)C ++ JSON解析库用于解析,并为数据结构。 它可以与 (一个模板库)无缝地工作。
动机
这个世界真的不需要另一个JSON解析器,我敢肯定还有其他人使用Spirit来解析JSON。 我的主要目标只是在实际用例中试用Spirit,并能够尽可能轻松地将JSON解析为boost::variant 。
用法
解析JSON:
# include < iostream>
# include < json>
int main () {
using boost::get;
std::string json_string{
" { \" names \" : [ "
" { \" name \" : \" Chris \" }, "
"
【文件预览】:
json.hpp-master
----.gitignore(5B)
----LICENSE(1KB)
----README.md(3KB)
----include()
--------json.hpp(4KB)
----test()
--------catch.hpp(328KB)
--------test_main.cpp(2KB)
--------CMakeLists.txt(83B)
----CMakeLists.txt(244B)