Skip to content

Adding easy way to write json - #103

Open
gbittoun wants to merge 1 commit into
kazuho:masterfrom
gbittoun:master
Open

Adding easy way to write json#103
gbittoun wants to merge 1 commit into
kazuho:masterfrom
gbittoun:master

Conversation

@gbittoun

Copy link
Copy Markdown

Adds an picojson::easyjson objects on which you can easily assign values. I admit it, this code might be doing lot of magic, but I think it is a good thing to provide the developers a way to write such things:

picojson::easyjson v;

v["foo"] = "bar"
v["baz"][0] = 1;
v["baz"][1] = "test";

and finally retrieve the following json: {"foo": "bar", "baz": [1. "test"]} in the end

Writing v.set<type>() then v.get<type>() was quite a pain for me.

Choice is yours, I only suggest… And code may be modified depending on your comments :-)
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant