GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing cpp.libhunt.com — qt-json Alternatives - C++ JSON | LibHunt qt-jsonA simple class for parsing JSON data into a QVariant hierarchy and vice versa.
DISCONTINUED.
You can find some alternatives below.
Take the C++ Developer Survey
- About 6 minutes on the tools, libraries and AI you use with C++. You get the results by email.
Take the survey »
Popularity
3.8
Stable
Activity
0.0
Stable
Stars
331
Watchers
25
Forks
107
Last Commit
Code Quality Rank:
L3
Programming language: C++
License: GNU General Public License v3.0 only
Tags:
JSON
qt-json alternatives and similar libraries
Based on the "JSON" category.
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
Promo
www.saashub.com
* Code Quality Rankings and insights are calculated and provided by Lumnify.
Do you think we are missing an alternative of qt-json or a related project? READMEThe qt-json project is a simple collection of functions for parsing and serializing JSON data to and from QVariant hierarchies. NOTE: Qt5 introduced a native JSON object class. If you are targeting Qt5, you should use that instead. HOW TO USEParsing JSONThe parser is really easy to use. Let's say we have the following QString of JSON data:
We would first call the parse-function:
Assuming the parser completed without errors, we can then go through the hierarchy:
The previous code would print out the following:
Serializing JSONTo write JSON data from Qt object is as simple as creating and assigning data to a QVariantMap/JsonObject:
The byte array 'data' contains valid JSON data:
Serializing JSON pretty-printBy default, the serialization will create a minified version, like following:
If you are debugging or logging, you may prefer to enable pretty-print mode globally, before serialize:
Obviously, you can disable it with:
After creating the QVariantMap, you can create a QVariantList/JsonArray and append the QVariantMaps.
This way you create a nested structure:
If you continue this process recursively, you nest more levels into the JSON structure. Using BuildersFor simplicity you can use builders, if you prefer. For example, create a
Or create a
Take a look at this example that rewrite the previous one:
3. CONTRIBUTINGSend in a pull request and bug the maintainer until it gets merged and published. Make sure to add yourself to AUTHORS. Do not miss the trending, libraries, news and articles with our weekly report.
Spin The Wheel Of Names
for a cryptographically secure random name picker.
Schedule a when to meet poll. |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |