DAW JSON Link
daw_from_json_fwd.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 "impl/version.h"
12 
15 #include "impl/daw_json_traits.h"
16 
17 #include <string_view>
18 
19 namespace daw::json {
20  inline namespace DAW_JSON_VER {
21 
34  template<typename JsonMember, bool KnownBounds = false, typename String,
35  auto... PolicyFlags>
36  [[nodiscard]] constexpr auto
37  from_json( String &&json_data, options::parse_flags_t<PolicyFlags...> );
38 
47  template<typename JsonMember, bool KnownBounds = false, typename String>
48  [[nodiscard]] constexpr auto from_json( String &&json_data );
49 
58  template<typename JsonMember, bool KnownBounds = false, typename String,
59  typename Allocator, auto... PolicyFlags>
60  [[nodiscard]] constexpr auto
61  from_json_alloc( String &&json_data, Allocator const &alloc,
62  options::parse_flags_t<PolicyFlags...> );
63 
72  template<typename JsonMember, bool KnownBounds = false, typename String,
73  typename Allocator>
74  [[nodiscard]] constexpr auto from_json_alloc( String &&json_data,
75  Allocator const &alloc );
76 
87  template<typename JsonMember, bool KnownBounds = false, typename String,
88  auto... PolicyFlags>
89  [[nodiscard]] constexpr auto
90  from_json( String &&json_data, std::string_view member_path,
91  options::parse_flags_t<PolicyFlags...> );
92 
103  template<typename JsonMember, bool KnownBounds = false, typename String>
104  [[nodiscard]] constexpr auto from_json( String &&json_data,
105  std::string_view member_path );
106 
117  template<typename JsonMember, bool KnownBounds = false, typename String,
118  typename Allocator, auto... PolicyFlags>
119  [[nodiscard]] constexpr auto
120  from_json_alloc( String &&json_data, std::string_view member_path,
121  Allocator const &alloc,
122  options::parse_flags_t<PolicyFlags...> );
123 
134  template<typename JsonMember, bool KnownBounds = false, typename String,
135  typename Allocator>
136  [[nodiscard]] constexpr auto from_json_alloc( String &&json_data,
137  std::string_view member_path,
138  Allocator const &alloc );
139 
147  template<typename JsonMember, bool KnownBounds = false, json_options_t P,
148  typename A, auto... PolicyFlags>
149  [[nodiscard]] inline constexpr auto
151  options::parse_flags_t<PolicyFlags...> );
152 
160  template<typename JsonMember, bool KnownBounds = false, json_options_t P,
161  typename A>
162  [[nodiscard]] inline constexpr auto
164 
175  template<typename JsonMember, bool KnownBounds = false, json_options_t P,
176  typename A, auto... PolicyFlags>
177  [[nodiscard]] constexpr auto
178  from_json( basic_json_value<P, A> value, std::string_view member_path,
179  options::parse_flags_t<PolicyFlags...> );
180 
191  template<typename JsonMember, bool KnownBounds, json_options_t P,
192  typename A>
193  [[nodiscard]] constexpr auto from_json( basic_json_value<P, A> value,
194  std::string_view member_path );
195 
209  template<typename JsonElement,
210  typename Container =
211  std::vector<json_details::from_json_result_t<JsonElement>>,
212  typename Constructor = use_default, bool KnownBounds = false,
213  typename String, auto... PolicyFlags>
214  [[nodiscard]] constexpr Container
215  from_json_array( String &&json_data, std::string_view member_path,
216  options::parse_flags_t<PolicyFlags...> );
217 
231  template<typename JsonElement,
232  typename Container =
233  std::vector<json_details::from_json_result_t<JsonElement>>,
234  typename Constructor = use_default, bool KnownBounds = false,
235  typename String>
236  [[nodiscard]] constexpr Container
237  from_json_array( String &&json_data, std::string_view member_path );
238 
249  template<typename JsonElement,
250  typename Container =
251  std::vector<json_details::from_json_result_t<JsonElement>>,
252  typename Constructor = use_default, bool KnownBounds = false,
253  typename String, auto... PolicyFlags>
254  [[nodiscard]] constexpr Container
255  from_json_array( String &&json_data,
256  options::parse_flags_t<PolicyFlags...> );
257 
268  template<typename JsonElement,
269  typename Container =
270  std::vector<json_details::from_json_result_t<JsonElement>>,
271  typename Constructor = use_default, bool KnownBounds = false,
272  typename String>
273  [[nodiscard]] constexpr Container from_json_array( String &&json_data );
274  } // namespace DAW_JSON_VER
275 } // namespace daw::json
constexpr Container from_json_array(String &&json_data, options::parse_flags_t< PolicyFlags... >)
Parse JSON data where the root item is an array.
constexpr auto from_json(String &&json_data, options::parse_flags_t< PolicyFlags... >)
Construct the JSONMember from the JSON document argument.
Definition: daw_from_json.h:39
constexpr auto from_json_alloc(String &&json_data, Allocator const &alloc, options::parse_flags_t< PolicyFlags... >)
Construct the JSONMember from the JSON document argument.
Customization point traits.
A non-owning container for arbitrary JSON values that allows movement/iteration through.
#define DAW_JSON_VER
The version string used in namespace definitions. Must be a valid namespace name.
Definition: version.h:25