DAW JSON Link
Loading...
Searching...
No Matches
daw_json_serialize_options_impl.h
Go to the documentation of this file.
1// Copyright (c) Darrell Wright
2//
3// Distributed under the Boost Software License, Version 1.0. (See accompanying
4// file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
5//
6// Official repository: https://github.com/beached/daw_json_link
7//
8
9#pragma once
10
11#include "version.h"
12
16
17namespace daw::json {
18 inline namespace DAW_JSON_VER {
19 namespace json_details {
20 template<typename>
21 inline constexpr bool is_output_option_v = false;
22
23 template<>
24 inline constexpr bool is_output_option_v<options::SerializationFormat> =
25 true;
26
27 template<>
28 inline constexpr unsigned
29 json_option_bits_width<options::SerializationFormat> = 1;
30
31 template<>
32 inline constexpr auto
33 default_json_option_value<options::SerializationFormat> =
34 options::SerializationFormat::Minified;
35
36 template<>
37 inline constexpr bool is_output_option_v<options::IndentationType> = true;
38
39 template<>
40 inline constexpr unsigned
41 json_option_bits_width<options::IndentationType> = 3;
42
43 template<>
44 inline constexpr auto
45 default_json_option_value<options::IndentationType> =
46 options::IndentationType::Space2;
47
48 template<>
49 inline constexpr bool
50 is_output_option_v<options::RestrictedStringOutput> = true;
51
52 template<>
53 inline constexpr unsigned
54 json_option_bits_width<options::RestrictedStringOutput> = 2;
55
56 template<>
57 inline constexpr auto
58 default_json_option_value<options::RestrictedStringOutput> =
59 options::RestrictedStringOutput::ErrorInvalidUTF8;
60
61 template<>
62 inline constexpr bool is_output_option_v<options::NewLineDelimiter> =
63 true;
64
65 template<>
66 inline constexpr unsigned
67 json_option_bits_width<options::NewLineDelimiter> = 1;
68
69 template<>
70 inline constexpr auto
71 default_json_option_value<options::NewLineDelimiter> =
72 options::NewLineDelimiter::n;
73
74 template<>
75 inline constexpr bool is_output_option_v<options::OutputTrailingComma> =
76 true;
77
78 template<>
79 inline constexpr unsigned
80 json_option_bits_width<options::OutputTrailingComma> = 1;
81
82 template<>
83 inline constexpr auto
84 default_json_option_value<options::OutputTrailingComma> =
85 options::OutputTrailingComma::No;
86
87 template<>
88 inline constexpr bool is_output_option_v<options::AllowEscapedNames> =
89 true;
90 } // namespace json_details
91 } // namespace DAW_JSON_VER
92} // namespace daw::json
string_writer grows its string with resize_and_overwrite, leaving the new bytes uninitialized,...
#define DAW_JSON_VER
The version string used in namespace definitions. Must be a valid namespace name.
Definition version.h:20