]> git.donarmstrong.com Git - bamtools.git/blob - src/third_party/jsoncpp/json_features.h
Merge branch 'master' of git://github.com/pezmaster31/bamtools
[bamtools.git] / src / third_party / jsoncpp / json_features.h
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
5
6 #ifndef CPPTL_JSON_FEATURES_H_INCLUDED
7 # define CPPTL_JSON_FEATURES_H_INCLUDED
8
9 # include "json_forwards.h"
10
11 namespace 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