C/C++ JSON parser [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
We have requirement of C/C++ Parser in my application. What application does is it calls rest webservice and takes output from service. If output is JSON , it should parse it and shows the result to end user.
Could you please recommend me good/best C/CPP JSON parser (according to you) so that I can use in my application?
When I search online, I am getting multiple JSON parsers. But I would like to know about the best.
Thanks in advance

Assuming you're happy with a C++ implementation of the parser, I've not had any issues with nlohmann/json; although there are faster libraries it has been fast enough for my requirements and has the advantages that:
It is very easy to integrate into your project (single header)
A clean and simple API without excessively verbose syntax
Good test coverage
The Github page linked above has a great overview so it's not worth me going into much more detail here.
For a comparison of libraries along multiple facets (not just performance) you could look here: miloyip/nativejson-benchmark

I highly recommend Cereal. It's a portable, easy to use serialization library for C++, that supports JSON, XML, plain text, and binary formats.

We are happy with RapidJson, which is in use for AssetImporterLib for the GLTF-importer.
You can find a performance test here ( 100% is best ). Regarding to these examples RapiJson has won.
Be never measured the performance on our own to this lib in special.

Related

quickJS documentation and/or well commented projects [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I am porting an in-house system from Duktape to quickJS to take advantage of the support for ES6 features and good module support (including dynamic imports).
Have ported some simple class libraries to be imported as shared object modules. But getting stumped with more advanced inter-operation issues. quickjs.h contains approximately 400 entries, but there are less than 2 pages of documentation for the C-API.
Any suggestions as to where more detailed documentation could be found?
Failing that pointers to any well documented project using quickJS might help. Yes, I have Googled and haven't found anything useful.
I am also in the same boat,QuickJS docs & examples are hard to find here are the best ones I found so far :
https://github.com/sntg-p/QuickJS-raylib : very nice as it wraps a good portion of the relatively large RayLib API
https://github.com/saghul/txiki.js might also have some nice things (as it wraps libuv amomngs other things
a more simple example https://github.com/calbertts/async-quickjs
hope the above examples help !

I need a library much like Java's GregorianCalendar but in C or C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
While this might not seem exactly like a programming question, non-programmers won't know what I'm talking about. If you can suggest a more appropriate stack* forum, I'll happily ask there, but I think this is my best shot.
libical is a good start, but it doesn't have anywhere near what I need.
I do not want to reinvent tons of calendar math functions if they already exist, and I also do not want to suck in boost or roguewave or anything like that just to do calendaring.
Any suggestions? I've looked and looked and found nothing, but my google-fu isn't supreme.
By rejecting Boost you're rejecting a library that's had not only extensive design review but also probably extensive testing by people who you can guess (hope) have experience with the picky picky details of datetime calculations.
But ok, I can actually understand the desire to avoid Boost if possible.
But you're entering a world where you have even more responsibility than usual to validate the design and implementation.
That said, this library looks like its promising for your purposes: Howard Hinnant's date library on github (see also his pages here for a man page and here for a description of the algorithms used. I have not used it, of course. (If you do take this suggestion, please report back here, so we'll all know about this library's worth.)
I suspect the best answer is going to be Boost's date_time library. Though you should see if your C++ framework has something already first. Always try to match your framework when you can.

XML DataBinding and C++ code generator [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
there's already a topic about it but I haven't found a helpful answer (http://stackoverflow.com/questions/1316320/a-c-code-generator-from-an-xml-spec).
I'm looking for a library or a tool which can read xsd grammar and then can write a corresponding object in c++ (.hpp, .cpp,...).
Except codesynthsesis, does someone know much about it?
There is a huge list of data binding code generators on http://www.w3.org/XML/Schema , just search the site for C++. Also please describe in detail why the answers on A C++ code generator from an XML spec weren't helpful.
The information at http://www.rpbourret.com/xml/XMLDataBinding.htm can be very helpful. But beware that the list of tools on that web site is slowly getting out of date. The W3C list of data binding tools http://www.w3.org/XML/Schema is outdated (the last update was way back in 2009).
I'm using the GSOAP toolkit from SourceForge for all of my XML C++ projects. Also works for plain C. It binds C/C++ to XML schemas automatically and is fully compliant with industry standards for XML, WSDL, SOAP, REST, XML-RPC, JSON, and WS-* protocols.
GSOAP is actively maintained, easy to use, and pretty efficient too.

What C/C++ library to use for HTML DOM building/changing? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I am using perl module HTML::DOM (link to CPAN) for building HTML DOM tree from HTML code and then changing it using standard DOM's removeAttribute, removeChild, innerHTML, createElement and so on.
But, I have found out it's really, really slow and eating too much memory (it's fully in perl, anyway). So, I thought that there will be some C/C++ library that does it faster and more efficiently (because it happens in every browser that have JavaScript support).
So far, I have not found anything. Maybe I am searching wrong?
edit: I will add. I would like it if it worked similarly to linked Perl module - by that, I really mean so I could use directly HTML's innerHTML, className, idName... Is it posible, or will I need to use general XML parser and then write these by myself?
edit2: OK, the slowness of the Perl module was actually my fault entirely. However, since I already asked, the question still stands :)
libgdome is a library adding a DOM implementation on top of libxml2.
Many of the faster higher-level language modules for this purpose (such as, in the Python world, lxml) tend to be built directly on libxml2, doing the DOM bits themselves.

What are some small, fast and lightweight open source applications (µTorrent -esque)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Possible duplicate
What is the best open source example of a lightweight
Windows Application?
µTorrent is a small bit-torrent client, a really small one. It doesn't come with an installer, just a exe, you drop in your PATH somewhere. It's super lightweight and yet feature rich. Plus it is the work of one man. It's also closed-source.
Many people have been curious about how it has been written, and there are hints here and there about a custom library etc. But the question is, are there any programs with attributes like µTorrent that are available with source code--attributes like speed, small size, awesomeness.
Possible related question (/questions/9603/what-is-some-great-source-code-to-read), but think smaller than something like the Linux kernel.
Clarification: I don't want examples of bit-torrent source code, but anything which is used by tons of people (validation of awesomeness) and also fast, small and awesome!
I think you should take a look at Notepad++ if you want to see a feature-rich low-consumption of power software :)
Netcat
It's the program that started all of the curiousity behind networks and how things WORK.
Everyone's looked at this source code.
rTorrent is a lightweight, feature-rich, console-only open-source torrent client.
I like Frhed, a simple open-source Windows hex editor.
FRESHMEAT is a great place to start. There are lots of small open source programs available that you can study.
Examples:
XML-RPC specification.C implementation for Python. Its easy to learn and its fun.
Heapq [\Lib\heapq.py] , xml-rpc [\Lib\xmlrpc] and lots of other codes in Python library are very well written.