![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
json test
jsoncpp/include/json/features.h@0:2ee762ea11b3, 2018-01-26 (annotated)
- Committer:
- tgw
- Date:
- Fri Jan 26 06:05:31 2018 +0000
- Revision:
- 0:2ee762ea11b3
json
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tgw | 0:2ee762ea11b3 | 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors |
tgw | 0:2ee762ea11b3 | 2 | // Distributed under MIT license, or public domain if desired and |
tgw | 0:2ee762ea11b3 | 3 | // recognized in your jurisdiction. |
tgw | 0:2ee762ea11b3 | 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE |
tgw | 0:2ee762ea11b3 | 5 | |
tgw | 0:2ee762ea11b3 | 6 | #ifndef CPPTL_JSON_FEATURES_H_INCLUDED |
tgw | 0:2ee762ea11b3 | 7 | #define CPPTL_JSON_FEATURES_H_INCLUDED |
tgw | 0:2ee762ea11b3 | 8 | |
tgw | 0:2ee762ea11b3 | 9 | #if !defined(JSON_IS_AMALGAMATION) |
tgw | 0:2ee762ea11b3 | 10 | #include "forwards.h" |
tgw | 0:2ee762ea11b3 | 11 | #endif // if !defined(JSON_IS_AMALGAMATION) |
tgw | 0:2ee762ea11b3 | 12 | |
tgw | 0:2ee762ea11b3 | 13 | #pragma pack(push, 8) |
tgw | 0:2ee762ea11b3 | 14 | |
tgw | 0:2ee762ea11b3 | 15 | namespace Json { |
tgw | 0:2ee762ea11b3 | 16 | |
tgw | 0:2ee762ea11b3 | 17 | /** \brief Configuration passed to reader and writer. |
tgw | 0:2ee762ea11b3 | 18 | * This configuration object can be used to force the Reader or Writer |
tgw | 0:2ee762ea11b3 | 19 | * to behave in a standard conforming way. |
tgw | 0:2ee762ea11b3 | 20 | */ |
tgw | 0:2ee762ea11b3 | 21 | class JSON_API Features { |
tgw | 0:2ee762ea11b3 | 22 | public: |
tgw | 0:2ee762ea11b3 | 23 | /** \brief A configuration that allows all features and assumes all strings |
tgw | 0:2ee762ea11b3 | 24 | * are UTF-8. |
tgw | 0:2ee762ea11b3 | 25 | * - C & C++ comments are allowed |
tgw | 0:2ee762ea11b3 | 26 | * - Root object can be any JSON value |
tgw | 0:2ee762ea11b3 | 27 | * - Assumes Value strings are encoded in UTF-8 |
tgw | 0:2ee762ea11b3 | 28 | */ |
tgw | 0:2ee762ea11b3 | 29 | static Features all(); |
tgw | 0:2ee762ea11b3 | 30 | |
tgw | 0:2ee762ea11b3 | 31 | /** \brief A configuration that is strictly compatible with the JSON |
tgw | 0:2ee762ea11b3 | 32 | * specification. |
tgw | 0:2ee762ea11b3 | 33 | * - Comments are forbidden. |
tgw | 0:2ee762ea11b3 | 34 | * - Root object must be either an array or an object value. |
tgw | 0:2ee762ea11b3 | 35 | * - Assumes Value strings are encoded in UTF-8 |
tgw | 0:2ee762ea11b3 | 36 | */ |
tgw | 0:2ee762ea11b3 | 37 | static Features strictMode(); |
tgw | 0:2ee762ea11b3 | 38 | |
tgw | 0:2ee762ea11b3 | 39 | /** \brief Initialize the configuration like JsonConfig::allFeatures; |
tgw | 0:2ee762ea11b3 | 40 | */ |
tgw | 0:2ee762ea11b3 | 41 | Features(); |
tgw | 0:2ee762ea11b3 | 42 | |
tgw | 0:2ee762ea11b3 | 43 | /// \c true if comments are allowed. Default: \c true. |
tgw | 0:2ee762ea11b3 | 44 | bool allowComments_; |
tgw | 0:2ee762ea11b3 | 45 | |
tgw | 0:2ee762ea11b3 | 46 | /// \c true if root must be either an array or an object value. Default: \c |
tgw | 0:2ee762ea11b3 | 47 | /// false. |
tgw | 0:2ee762ea11b3 | 48 | bool strictRoot_; |
tgw | 0:2ee762ea11b3 | 49 | |
tgw | 0:2ee762ea11b3 | 50 | /// \c true if dropped null placeholders are allowed. Default: \c false. |
tgw | 0:2ee762ea11b3 | 51 | bool allowDroppedNullPlaceholders_; |
tgw | 0:2ee762ea11b3 | 52 | |
tgw | 0:2ee762ea11b3 | 53 | /// \c true if numeric object key are allowed. Default: \c false. |
tgw | 0:2ee762ea11b3 | 54 | bool allowNumericKeys_; |
tgw | 0:2ee762ea11b3 | 55 | }; |
tgw | 0:2ee762ea11b3 | 56 | |
tgw | 0:2ee762ea11b3 | 57 | } // namespace Json |
tgw | 0:2ee762ea11b3 | 58 | |
tgw | 0:2ee762ea11b3 | 59 | #pragma pack(pop) |
tgw | 0:2ee762ea11b3 | 60 | |
tgw | 0:2ee762ea11b3 | 61 | #endif // CPPTL_JSON_FEATURES_H_INCLUDED |