1 // Copyright 2007-2010 Baptiste Lepilleur
2 // Distributed under MIT license, or public domain if desired and
3 // recognized in your jurisdiction.
4 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
6 #ifndef CPPTL_JSON_FEATURES_H_INCLUDED
7 # define CPPTL_JSON_FEATURES_H_INCLUDED
9 # include "json_forwards.h"
13 /** \brief Configuration passed to reader and writer.
14 * This configuration object can be used to force the Reader or Writer
15 * to behave in a standard conforming way.
17 class JSON_API Features
20 /** \brief A configuration that allows all features and assumes all strings are UTF-8.
21 * - C & C++ comments are allowed
22 * - Root object can be any JSON value
23 * - Assumes Value strings are encoded in UTF-8
25 static Features all();
27 /** \brief A configuration that is strictly compatible with the JSON specification.
28 * - Comments are forbidden.
29 * - Root object must be either an array or an object value.
30 * - Assumes Value strings are encoded in UTF-8
32 static Features strictMode();
34 /** \brief Initialize the configuration like JsonConfig::allFeatures;
38 /// \c true if comments are allowed. Default: \c true.
41 /// \c true if root must be either an array or an object value. Default: \c false.
47 #endif // CPPTL_JSON_FEATURES_H_INCLUDED