Skip to content

Commit

Permalink
Document the new JsonObject behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytheway committed Oct 14, 2019
1 parent 854da9b commit 7cfc274
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,21 @@ class JsonOut
* if (!jo.read("messages", messages)) {
* DebugLog() << "No messages.";
* }
*
*
* Automatic error checking
* ------------------------
*
* By default, when a JsonObject is destroyed (or when you call finish) it will
* check to see whether every member of the object was referenced in some way
* (even simply checking for the existence of the member is suffucient).
*
* If not all the members were referenced, then an error will be written to the
* log (which in particular will cause the tests to fail).
*
* If you don't want this behaviour, then call allow_omitted_members() before
* the JsonObject is destroyed. Calling str() also suppresses it (on the basis
* that you may be intending to re-parse that string later).
*/
class JsonObject
{
Expand Down

0 comments on commit 7cfc274

Please sign in to comment.