Allow trailing comma in objects

This commit is contained in:
Jacob Bundgaard
2019-10-16 17:07:41 +02:00
committed by Christopher Dunn
parent d2e6a971f4
commit 01db7b7430
7 changed files with 20 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ public:
/** \brief A configuration that allows all features and assumes all strings
* are UTF-8.
* - C & C++ comments are allowed
* - Trailing commas in objects and arrays are allowed.
* - Root object can be any JSON value
* - Assumes Value strings are encoded in UTF-8
*/
@@ -31,6 +32,7 @@ public:
/** \brief A configuration that is strictly compatible with the JSON
* specification.
* - Comments are forbidden.
* - Trailing commas in objects and arrays are forbidden.
* - Root object must be either an array or an object value.
* - Assumes Value strings are encoded in UTF-8
*/
@@ -43,6 +45,9 @@ public:
/// \c true if comments are allowed. Default: \c true.
bool allowComments_{true};
/// \c true if trailing commas in objects and arrays are allowed. Default \c true.
bool allowTrailingCommas_{true};
/// \c true if root must be either an array or an object value. Default: \c
/// false.
bool strictRoot_{false};