You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.8 KiB

7 years ago
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
  1. // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
  2. // Distributed under MIT license, or public domain if desired and
  3. // recognized in your jurisdiction.
  4. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
  5. #ifndef CPPTL_JSON_FEATURES_H_INCLUDED
  6. #define CPPTL_JSON_FEATURES_H_INCLUDED
  7. #if ! defined(JSON_IS_AMALGAMATION)
  8. #include "forwards.h"
  9. #endif // if !defined(JSON_IS_AMALGAMATION)
  10. #pragma pack(push, 8)
  11. namespace Json
  12. {
  13. /** \brief Configuration passed to reader and writer.
  14. * This configuration object can be used to force the Reader or Writer
  15. * to behave in a standard conforming way.
  16. */
  17. class JSON_API Features
  18. {
  19. public:
  20. /** \brief A configuration that allows all features and assumes all strings
  21. * are UTF-8.
  22. * - C & C++ comments are allowed
  23. * - Root object can be any JSON value
  24. * - Assumes Value strings are encoded in UTF-8
  25. */
  26. static Features all();
  27. /** \brief A configuration that is strictly compatible with the JSON
  28. * specification.
  29. * - Comments are forbidden.
  30. * - Root object must be either an array or an object value.
  31. * - Assumes Value strings are encoded in UTF-8
  32. */
  33. static Features strictMode();
  34. /** \brief Initialize the configuration like JsonConfig::allFeatures;
  35. */
  36. Features();
  37. /// \c true if comments are allowed. Default: \c true.
  38. bool allowComments_{true};
  39. /// \c true if root must be either an array or an object value. Default: \c
  40. /// false.
  41. bool strictRoot_{false};
  42. /// \c true if dropped null placeholders are allowed. Default: \c false.
  43. bool allowDroppedNullPlaceholders_{false};
  44. /// \c true if numeric object key are allowed. Default: \c false.
  45. bool allowNumericKeys_{false};
  46. };
  47. } // namespace Json
  48. #pragma pack(pop)
  49. #endif // CPPTL_JSON_FEATURES_H_INCLUDED