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