wxSimpleJSON - JSON Library

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Post Reply
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

wxSimpleJSON - JSON Library

Post by evstevemd »

There was old discussion about it and was rejected as part of wxWidgets. But I have been using it and it have simplified our life. Please meed wxSimpleJSON, CJSON Warapper written by Eran Ifrah with some updated

https://github.com/hosannahighertech/wxSimpleJSON

Let me know if you find it useful!
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxSimpleJSON - JSON Library

Post by doublemax »

I don't like that it consists of multiple files. Personally i'prefer a single-file, header only solution.

I use this: https://github.com/nbsdx/SimpleJSON/blo ... r/json.hpp
Of course it's not "wx aware", so you need some additional casts or encoding conversions sometimes, but i can live with that.
Use the source, Luke!
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: wxSimpleJSON - JSON Library

Post by evstevemd »

doublemax wrote: Mon Jun 03, 2019 4:03 pm I don't like that it consists of multiple files. Personally i'prefer a single-file, header only solution.

I use this: https://github.com/nbsdx/SimpleJSON/blo ... r/json.hpp
Of course it's not "wx aware", so you need some additional casts or encoding conversions sometimes, but i can live with that.
I don't know how to generate single header, if you know how, or have a pointer I will gladly do that. I know few libraries (plus SQLite3) have scripts to do that, but currently I have no time to dig into them. So any idea to get me started without reading too much is appreciated
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxSimpleJSON - JSON Library

Post by doublemax »

Honestly, i don't know if it's worth the effort. Most people probably won't care to use multiple files.
Use the source, Luke!
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: wxSimpleJSON - JSON Library

Post by evstevemd »

doublemax wrote: Mon Jun 03, 2019 4:32 pm Honestly, i don't know if it's worth the effort. Most people probably won't care to use multiple files.
I know, but you can't ignore convenience of single header library :)

I will try to find time in future and see if I can make script for that
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
iwbnwif
Super wx Problem Solver
Super wx Problem Solver
Posts: 282
Joined: Tue Mar 19, 2013 8:52 pm

Re: wxSimpleJSON - JSON Library

Post by iwbnwif »

There was old discussion about it and was rejected as part of wxWidgets. But I have been using it and it have simplified our life. Please meed wxSimpleJSON, CJSON Warapper written by Eran Ifrah with some updated
I think that this library is a good idea and wish it had been accepted as part of wxWidgets as that would solve the multiple file issue.

Just as a suggestion though, why not merge the two .cpp files and three .hpp into one .cpp and one .hpp. Surely, it would then be simple enough to add those two to a project?

I appreciate that it might make it harder to maintain, but cJSON seems pretty stable, and who says that the next change won't break the wrapper code anyway.
wxWidgets 3.1.2, MinGW64 8.1.0, g++ 8.1.0, Ubuntu 19.04, Windows 10, CodeLite + wxCrafter
Some people, when confronted with a GUI problem, think "I know, I'll use Eclipse RCP". Now they have two problems.
Kvaz1r
Super wx Problem Solver
Super wx Problem Solver
Posts: 357
Joined: Tue Jun 07, 2016 1:07 pm

Re: wxSimpleJSON - JSON Library

Post by Kvaz1r »

There is amalgamate project for creating single header file you also can use it.
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: wxSimpleJSON - JSON Library

Post by evstevemd »

iwbnwif wrote: Mon Jun 03, 2019 7:38 pm I think that this library is a good idea and wish it had been accepted as part of wxWidgets as that would solve the multiple file issue.
I agree, but then the wxTeam, didn't find it a good idea. Since I have used it with success I though sharing would be a better way of saying thank you to Eran.
iwbnwif wrote: Mon Jun 03, 2019 7:38 pm Just as a suggestion though, why not merge the two .cpp files and three .hpp into one .cpp and one .hpp. Surely, it would then be simple enough to add those two to a project?
Can you make a PR? Never done that before and am not sure how hpp file looks like ;)
iwbnwif wrote: Mon Jun 03, 2019 7:38 pm I appreciate that it might make it harder to maintain, but cJSON seems pretty stable, and who says that the next change won't break the wrapper code anyway.
CJSON doesn't change swiftly so shouldn't be a problem.
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: wxSimpleJSON - JSON Library

Post by evstevemd »

Kvaz1r wrote: Tue Jun 04, 2019 6:49 am There is amalgamate project for creating single header file you also can use it.
That is a cool project. I will need to find time to write unit tests to make sure the final hpp does not break somewhere.
Again thank you!
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Post Reply