annotate json/features.h @ 49:178642d134a7 tip

xtra files
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Wed, 01 May 2013 17:34:33 +0100
parents 346807b47860
children
rev   line source
rt300@9 1 #ifndef CPPTL_JSON_FEATURES_H_INCLUDED
rt300@9 2 # define CPPTL_JSON_FEATURES_H_INCLUDED
rt300@9 3
rt300@9 4 # include "forwards.h"
rt300@9 5
rt300@9 6 namespace Json {
rt300@9 7
rt300@9 8 /** \brief Configuration passed to reader and writer.
rt300@9 9 * This configuration object can be used to force the Reader or Writer
rt300@9 10 * to behave in a standard conforming way.
rt300@9 11 */
rt300@9 12 class JSON_API Features
rt300@9 13 {
rt300@9 14 public:
rt300@9 15 /** \brief A configuration that allows all features and assumes all strings are UTF-8.
rt300@9 16 * - C & C++ comments are allowed
rt300@9 17 * - Root object can be any JSON value
rt300@9 18 * - Assumes Value strings are encoded in UTF-8
rt300@9 19 */
rt300@9 20 static Features all();
rt300@9 21
rt300@9 22 /** \brief A configuration that is strictly compatible with the JSON specification.
rt300@9 23 * - Comments are forbidden.
rt300@9 24 * - Root object must be either an array or an object value.
rt300@9 25 * - Assumes Value strings are encoded in UTF-8
rt300@9 26 */
rt300@9 27 static Features strictMode();
rt300@9 28
rt300@9 29 /** \brief Initialize the configuration like JsonConfig::allFeatures;
rt300@9 30 */
rt300@9 31 Features();
rt300@9 32
rt300@9 33 /// \c true if comments are allowed. Default: \c true.
rt300@9 34 bool allowComments_;
rt300@9 35
rt300@9 36 /// \c true if root must be either an array or an object value. Default: \c false.
rt300@9 37 bool strictRoot_;
rt300@9 38 };
rt300@9 39
rt300@9 40 } // namespace Json
rt300@9 41
rt300@9 42 #endif // CPPTL_JSON_FEATURES_H_INCLUDED