|
||||
File indexing completed on 2025-01-18 09:39:04
0001 // 0002 // Copyright (c) 2023 Dmitry Arkhipov (grisumbras@yandex.ru) 0003 // 0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying 0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 0006 // 0007 // Official repository: https://github.com/boostorg/json 0008 // 0009 0010 #ifndef BOOST_JSON_SERIALIZE_OPTIONS_HPP 0011 #define BOOST_JSON_SERIALIZE_OPTIONS_HPP 0012 0013 #include <boost/json/detail/config.hpp> 0014 #include <iosfwd> 0015 0016 namespace boost { 0017 namespace json { 0018 0019 /** Serialize options 0020 0021 This structure is used for specifying whether to allow non-standard 0022 extensions. Default-constructed options specify that only standard JSON is 0023 produced. 0024 0025 @see 0026 @ref serialize, 0027 @ref serializer. 0028 */ 0029 struct serialize_options 0030 { 0031 /** Non-standard extension option 0032 0033 Output `Infinity`, `-Infinity` and `NaN` for positive infinity, 0034 negative infinity, and "not a number" doubles. 0035 0036 @see 0037 @ref serialize, 0038 @ref serializer. 0039 */ 0040 bool allow_infinity_and_nan = false; 0041 0042 /** Set JSON serialization options on input stream. 0043 The function stores serialization options in the private storage of the 0044 stream. If the stream fails to allocate necessary private storage, 0045 `badbit` will be set on it. 0046 0047 @return Reference to `os`. 0048 0049 @par Complexity 0050 Amortized constant (due to potential memory allocation by the stream). 0051 0052 @par Exception Safety 0053 Strong guarantee. 0054 The stream may throw as configured by 0055 [`std::ios::exceptions`](https://en.cppreference.com/w/cpp/io/basic_ios/exceptions). 0056 0057 @param os The output stream. 0058 0059 @param opts The options to store. 0060 */ 0061 BOOST_JSON_DECL 0062 friend 0063 std::ostream& 0064 operator<<( std::ostream& os, serialize_options const& opts ); 0065 }; 0066 0067 } // namespace json 0068 } // namespace boost 0069 0070 #endif // BOOST_JSON_SERIALIZE_OPTIONS_HPP
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |