在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:cierelabs/json_spirit开源软件地址:https://github.com/cierelabs/json_spirit开源编程语言:C++ 92.5%开源软件介绍:json spiritA json library using Boost.Spirit V2 and X3 for the parser. The primary goal of the json spirit library was to create a conformant json parser that resulted in a json object that could be manipulated much like in javascript or python. Quick Example// the json::value is the primary data type
// you can simply assign it values
json::value v = 42;
v = "foo";
v = true;
v = 14.5;
// you can also treat the json::value like an array
v[0] = "foo";
v[1] = true;
// or a json object
v["foo"] = 42;
v["bar"] = false;
// and of course, these can be more complex
json::value z;
z[4] = v;
std::cout << z << "\n"; which would result in:
BuildingWe have CMake and Boost.Build support. CMakeFor CMake, do this to build the library:
You may specify the version of Boost to build against by defining BOOST_ROOT on the CMake command line like this:
To run the unit tests:
Using in another CMakeLists.txtOne way to use the json library in another CMake project is to treat it as an external project. Here is an example of how to do that:
and for your specific target you can:
Boost.BuildFor Boost.Build, we assume either your user-config.jam file has a line like this:
or you have set the environment variable BOOST_ROOT to the location of the boost version you want to use. You can build the library via:
You can build the tests via:
Bazel BuildFor bazel depending on this library using the bazel build system add the following to your load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "com_github_cierelabs_json_spirit",
remote = "https://github.com/cierelabs/json_spirit",
commit = "371c3b5d283f6272860d4d2eac996591ffad259c"
)
load("@com_github_cierelabs_json_spirit//:json_spirit_deps.bzl", "json_spirit_deps")
json_spirit_deps()
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
boost_deps() The library can now be depended on using the target cc_library(
name = "some_lib",
deps = ["@com_github_cierelabs_json_spirit:json_spirit"],
# ...
) DocumentationComing soon. Unit tests located in Licensing
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论