ian@0
|
1 // Copyright 2007-2010 Baptiste Lepilleur
|
ian@0
|
2 // Distributed under MIT license, or public domain if desired and
|
ian@0
|
3 // recognized in your jurisdiction.
|
ian@0
|
4 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
ian@0
|
5
|
ian@0
|
6 #ifndef CPPTL_JSON_FEATURES_H_INCLUDED
|
ian@0
|
7 # define CPPTL_JSON_FEATURES_H_INCLUDED
|
ian@0
|
8
|
ian@0
|
9 #if !defined(JSON_IS_AMALGAMATION)
|
ian@0
|
10 # include "forwards.h"
|
ian@0
|
11 #endif // if !defined(JSON_IS_AMALGAMATION)
|
ian@0
|
12
|
ian@0
|
13 namespace Json {
|
ian@0
|
14
|
ian@0
|
15 /** \brief Configuration passed to reader and writer.
|
ian@0
|
16 * This configuration object can be used to force the Reader or Writer
|
ian@0
|
17 * to behave in a standard conforming way.
|
ian@0
|
18 */
|
ian@0
|
19 class JSON_API Features
|
ian@0
|
20 {
|
ian@0
|
21 public:
|
ian@0
|
22 /** \brief A configuration that allows all features and assumes all strings are UTF-8.
|
ian@0
|
23 * - C & C++ comments are allowed
|
ian@0
|
24 * - Root object can be any JSON value
|
ian@0
|
25 * - Assumes Value strings are encoded in UTF-8
|
ian@0
|
26 */
|
ian@0
|
27 static Features all();
|
ian@0
|
28
|
ian@0
|
29 /** \brief A configuration that is strictly compatible with the JSON specification.
|
ian@0
|
30 * - Comments are forbidden.
|
ian@0
|
31 * - Root object must be either an array or an object value.
|
ian@0
|
32 * - Assumes Value strings are encoded in UTF-8
|
ian@0
|
33 */
|
ian@0
|
34 static Features strictMode();
|
ian@0
|
35
|
ian@0
|
36 /** \brief Initialize the configuration like JsonConfig::allFeatures;
|
ian@0
|
37 */
|
ian@0
|
38 Features();
|
ian@0
|
39
|
ian@0
|
40 /// \c true if comments are allowed. Default: \c true.
|
ian@0
|
41 bool allowComments_;
|
ian@0
|
42
|
ian@0
|
43 /// \c true if root must be either an array or an object value. Default: \c false.
|
ian@0
|
44 bool strictRoot_;
|
ian@0
|
45 };
|
ian@0
|
46
|
ian@0
|
47 } // namespace Json
|
ian@0
|
48
|
ian@0
|
49 #endif // CPPTL_JSON_FEATURES_H_INCLUDED
|