Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-20 22:39:44

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