Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:00:27

0001 #ifndef CPPTL_JSON_FEATURES_H_INCLUDED
0002 #define CPPTL_JSON_FEATURES_H_INCLUDED
0003 
0004 #include "forwards.h"
0005 
0006 namespace Json {
0007 
0008   /** \brief Configuration passed to reader and writer.
0009     * This configuration object can be used to force the Reader or Writer
0010     * to behave in a standard conforming way.
0011     */
0012   class JSON_API Features {
0013   public:
0014     /** \brief A configuration that allows all features and assumes all strings are UTF-8.
0015        * - C & C++ comments are allowed
0016        * - Root object can be any JSON value
0017        * - Assumes Value strings are encoded in UTF-8
0018        */
0019     static Features all();
0020 
0021     /** \brief A configuration that is strictly compatible with the JSON specification.
0022        * - Comments are forbidden.
0023        * - Root object must be either an array or an object value.
0024        * - Assumes Value strings are encoded in UTF-8
0025        */
0026     static Features strictMode();
0027 
0028     /** \brief Initialize the configuration like JsonConfig::allFeatures;
0029        */
0030     Features();
0031 
0032     /// \c true if comments are allowed. Default: \c true.
0033     bool allowComments_;
0034 
0035     /// \c true if root must be either an array or an object value. Default: \c false.
0036     bool strictRoot_;
0037   };
0038 
0039 }  // namespace Json
0040 
0041 #endif  // CPPTL_JSON_FEATURES_H_INCLUDED