I've spent the last week or so tinkering with my C++11 JSON experiment, and now actually seems to be functional.
There's a lot of work yet to do! But it has basic functionality now, so I've decided to open the thing up for public consumption. I've released it under the MIT license, and made the source code available on Bitbucket.
This is the library that I wished I had time to write for the last couple years. My previous job included a lot of work using JSON-RPC to communicate between web applications and C++ applications. We used cJSON extensively, but it's C interface just doesn't look right in C++ code.
This library tries to take advantage of the new C++11-isms, move constructors, lambdas, uniform initialization, etc.
It's is still in the very experimental stage, it's interface is likely going to change, and has a few bugs. Check it out if you like.
Sunday, March 9, 2014
Tuesday, March 4, 2014
The experiment: a C++11 JSON library
Introducing the json experiment, a new library that I'm building to create, manipulate, and parse JSON in C++11.
For example, objects can be created by using an initializer_list:
If that's not cool enough, how about using an initializer list with a vector of objects?
More to come.
For example, objects can be created by using an initializer_list:
jsonex::object json{
{"A", {{"A1", 1}, {"A2", 2} }},
{"B", {{"B1", 1}, {"B2", 2} }},
{"C", {{"C1", {{"C11", 11}, {"C12", 12} }}, {"C2", 2} }},
};
If that's not cool enough, how about using an initializer list with a vector of objects?
std::vector json_vector{1, 2, 3, "A", false, nullptr};
I'm about 3 days into this project, but the code above is taken directly from some of the unit tests, so I'm a bit encouraged that this may turn out to be something useful. I hope to get it up on bitbucket pretty soon.More to come.
Subscribe to:
Comments (Atom)