ian@0: // Copyright 2007-2010 Baptiste Lepilleur ian@0: // Distributed under MIT license, or public domain if desired and ian@0: // recognized in your jurisdiction. ian@0: // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE ian@0: ian@0: #ifndef CPPTL_JSON_FEATURES_H_INCLUDED ian@0: # define CPPTL_JSON_FEATURES_H_INCLUDED ian@0: ian@0: #if !defined(JSON_IS_AMALGAMATION) ian@0: # include "forwards.h" ian@0: #endif // if !defined(JSON_IS_AMALGAMATION) ian@0: ian@0: namespace Json { ian@0: ian@0: /** \brief Configuration passed to reader and writer. ian@0: * This configuration object can be used to force the Reader or Writer ian@0: * to behave in a standard conforming way. ian@0: */ ian@0: class JSON_API Features ian@0: { ian@0: public: ian@0: /** \brief A configuration that allows all features and assumes all strings are UTF-8. ian@0: * - C & C++ comments are allowed ian@0: * - Root object can be any JSON value ian@0: * - Assumes Value strings are encoded in UTF-8 ian@0: */ ian@0: static Features all(); ian@0: ian@0: /** \brief A configuration that is strictly compatible with the JSON specification. ian@0: * - Comments are forbidden. ian@0: * - Root object must be either an array or an object value. ian@0: * - Assumes Value strings are encoded in UTF-8 ian@0: */ ian@0: static Features strictMode(); ian@0: ian@0: /** \brief Initialize the configuration like JsonConfig::allFeatures; ian@0: */ ian@0: Features(); ian@0: ian@0: /// \c true if comments are allowed. Default: \c true. ian@0: bool allowComments_; ian@0: ian@0: /// \c true if root must be either an array or an object value. Default: \c false. ian@0: bool strictRoot_; ian@0: }; ian@0: ian@0: } // namespace Json ian@0: ian@0: #endif // CPPTL_JSON_FEATURES_H_INCLUDED