Path: blob/master/Utilities/cmjsoncpp/include/json/json_features.h
3156 views
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors1// Distributed under MIT license, or public domain if desired and2// recognized in your jurisdiction.3// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE45#ifndef JSON_FEATURES_H_INCLUDED6#define JSON_FEATURES_H_INCLUDED78#if !defined(JSON_IS_AMALGAMATION)9#include "forwards.h"10#endif // if !defined(JSON_IS_AMALGAMATION)1112#if !defined(__SUNPRO_CC)13#pragma pack(push)14#pragma pack()15#endif1617namespace Json {1819/** \brief Configuration passed to reader and writer.20* This configuration object can be used to force the Reader or Writer21* to behave in a standard conforming way.22*/23class JSON_API Features {24public:25/** \brief A configuration that allows all features and assumes all strings26* are UTF-8.27* - C & C++ comments are allowed28* - Root object can be any JSON value29* - Assumes Value strings are encoded in UTF-830*/31static Features all();3233/** \brief A configuration that is strictly compatible with the JSON34* specification.35* - Comments are forbidden.36* - Root object must be either an array or an object value.37* - Assumes Value strings are encoded in UTF-838*/39static Features strictMode();4041/** \brief Initialize the configuration like JsonConfig::allFeatures;42*/43Features();4445/// \c true if comments are allowed. Default: \c true.46bool allowComments_{true};4748/// \c true if root must be either an array or an object value. Default: \c49/// false.50bool strictRoot_{false};5152/// \c true if dropped null placeholders are allowed. Default: \c false.53bool allowDroppedNullPlaceholders_{false};5455/// \c true if numeric object key are allowed. Default: \c false.56bool allowNumericKeys_{false};57};5859} // namespace Json6061#if !defined(__SUNPRO_CC)62#pragma pack(pop)63#endif6465#endif // JSON_FEATURES_H_INCLUDED666768