Skip to content
Chen edited this page Jan 20, 2020 · 17 revisions

Table of Contents

General

I have an old compiler/platform. Do I need C++11?

We are switching to C++11 only. But our old code still works on old compilers. See the pre-C++11 branch, which will be in light-maintenance-only mode.

How do I write into array values?

https://sourceforge.net/p/jsoncpp/discussion/483465/thread/24cb7c88/

How do I fix the locale, for skipping commas in numbers?

You need this:

set locale(LC_NUMERIC, "POSIX")
after any other locale changes. Here is more info.

How can I get stricter JSON parsing?

Json::Reader reader(Json::Features::strictMode());
See e.g. issue #39.

(With more recent code, set strictmode in settings.)

Why has the formatting changed to write a single value per line?

You need *commentStyle* `"None"`. See issue #181.

How do I get rid of newlinews?

If you set indentation to `""`, then newlines are also omitted.

How can I walk through the keys and compare values?

How can I query a webpage that returns JSON and parse the results?

Here is a code sample using libcurl for HTTP functionality.

Where can I find prebuilt binaries?

See issue #236:

Project

Where are the API docs?

In a separate repo, to minimize the size of the code repo:

The repository:
https://github.com/open-source-parsers/jsoncpp-docs
The web browsable version:
http://open-source-parsers.github.io/jsoncpp-docs

Are you up-to-date with Chromium patches?

Almost. We plan to be.

Where are older questions and issues?

Windows

error: ambiguous overload for `operator[]` in `Json::Value`

Sorry. See discussion.

py amalgamate.py does not work on windows console

How to Fix :
The shebang (top line) is preventing windows from running the script correctly.
Take out the shebang on windows and run the command with

py amalgamate.py COMMAND_LINE_ARGUMENTS
The script will work as expected.
Thanks @TheMaverickProgrammer in Issue#1129

Other platforms

How do I cross-compile for ARM?

Try ideas in issue #243:

MediaWiki

Why are you using media wiki here?

Because it provides a nice TOC for all the questions.