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: 2239
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

wxSimpleJSON - JSON Library

Post by evstevemd » Mon Jun 03, 2019 5:11 am

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?
[Ubuntu 15.04/Windows 10 Pro - GCC/MinGW, CodeLite IDE et al]

User avatar
doublemax
Moderator
Moderator
Posts: 13879
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxSimpleJSON - JSON Library

Post by doublemax » 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.
Use the source, Luke!

User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2239
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Re: wxSimpleJSON - JSON Library

Post by evstevemd » Mon Jun 03, 2019 4:26 pm

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?
[Ubuntu 15.04/Windows 10 Pro - GCC/MinGW, CodeLite IDE et al]

User avatar
doublemax
Moderator
Moderator
Posts: 13879
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxSimpleJSON - JSON Library

Post by doublemax » 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.
Use the source, Luke!

User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2239
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Re: wxSimpleJSON - JSON Library

Post by evstevemd » Mon Jun 03, 2019 5:14 pm

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?
[Ubuntu 15.04/Windows 10 Pro - GCC/MinGW, CodeLite IDE et al]

iwbnwif
Super wx Problem Solver
Super wx Problem Solver
Posts: 273
Joined: Tue Mar 19, 2013 8:52 pm

Re: wxSimpleJSON - JSON Library

Post by iwbnwif » Mon Jun 03, 2019 7:38 pm

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
Earned some good credits
Earned some good credits
Posts: 119
Joined: Tue Jun 07, 2016 1:07 pm

Re: wxSimpleJSON - JSON Library

Post by Kvaz1r » Tue Jun 04, 2019 6:49 am

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: 2239
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Re: wxSimpleJSON - JSON Library

Post by evstevemd » Wed Jun 05, 2019 8:12 pm

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?
[Ubuntu 15.04/Windows 10 Pro - GCC/MinGW, CodeLite IDE et al]

User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2239
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Re: wxSimpleJSON - JSON Library

Post by evstevemd » Wed Jun 05, 2019 8:15 pm

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?
[Ubuntu 15.04/Windows 10 Pro - GCC/MinGW, CodeLite IDE et al]

Post Reply