emlabcpp
modern opinionated embedded C++ library
json.h
Go to the documentation of this file.
1 
24 #pragma once
25 
26 #include "../../pmr/memory_resource.h"
27 #include "./base.h"
28 
29 #include <optional>
30 
31 #ifdef EMLABCPP_USE_NLOHMANN_JSON
32 #include <nlohmann/json.hpp>
33 
34 namespace emlabcpp::testing
35 {
36 
37 std::optional< value_type > json_to_value_type( nlohmann::json const& j );
38 
39 nlohmann::json value_type_to_json( value_type const& tv );
40 
41 key_type json_to_key_type( nlohmann::json const& j );
42 
43 std::optional< data_tree >
44 json_to_data_tree( pmr::memory_resource& mem_res, nlohmann::json const& inpt );
45 
46 nlohmann::json data_tree_to_json( data_tree const& tree );
47 
48 } // namespace emlabcpp::testing
49 
50 #endif
MIT License.
Definition: base.h:37
key_type_buffer key_type
Definition: base.h:47
std::variant< int64_t, float, bool, string_buffer > value_type
Definition: base.h:51
contiguous_tree< key_type, value_type > data_tree
Definition: base.h:55