blob: fd8e3509a206c4659b1541b37603c2470348e03a [file] [log] [blame]
Baptiste Lepilleur7469f1d2010-04-20 21:35:19 +00001// 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
5
6#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
7# define CPPTL_JSON_FEATURES_H_INCLUDED
8
9# include "forwards.h"
10
11namespace Json {
12
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.
16 */
17 class JSON_API Features
18 {
19 public:
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
24 */
25 static Features all();
26
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
31 */
32 static Features strictMode();
33
34 /** \brief Initialize the configuration like JsonConfig::allFeatures;
35 */
36 Features();
37
38 /// \c true if comments are allowed. Default: \c true.
39 bool allowComments_;
40
41 /// \c true if root must be either an array or an object value. Default: \c false.
42 bool strictRoot_;
43 };
44
45} // namespace Json
46
47#endif // CPPTL_JSON_FEATURES_H_INCLUDED