$darkmode
cloe
json.hpp
Go to the documentation of this file.
1
/*
2
* Copyright 2020 Robert Bosch GmbH
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*
16
* SPDX-License-Identifier: Apache-2.0
17
*/
25
#pragma once
26
#ifndef FABLE_JSON_HPP_
27
#define FABLE_JSON_HPP_
28
29
#include <string>
// for string
30
31
#include <nlohmann/json.hpp>
// for Json
32
33
namespace
fable
{
34
43
extern
bool
NLOHMANN_JSON_ALLOW_COMMENTS
;
44
52
extern
bool
NLOHMANN_JSON_USE_EXCEPTIONS
;
53
62
using
Json
= nlohmann::json;
63
70
using
JsonPointer
= Json::json_pointer;
71
78
using
JsonType
= Json::value_t;
79
95
std::string to_string(
JsonType
);
96
104
template
<
typename
InputType>
105
inline
Json
parse_json
(InputType&& input) {
106
return
Json::parse(std::forward<InputType>(input),
nullptr
, NLOHMANN_JSON_USE_EXCEPTIONS,
107
NLOHMANN_JSON_ALLOW_COMMENTS);
108
}
109
110
}
// namespace fable
111
112
#endif // FABLE_JSON_HPP_
fable::Json
nlohmann::json Json
Definition:
json.hpp:62
fable::JsonType
Json::value_t JsonType
Definition:
json.hpp:78
fable
Definition:
conf.hpp:70
fable::NLOHMANN_JSON_USE_EXCEPTIONS
bool NLOHMANN_JSON_USE_EXCEPTIONS
Definition:
json.cpp:37
fable::JsonPointer
Json::json_pointer JsonPointer
Definition:
json.hpp:70
fable::NLOHMANN_JSON_ALLOW_COMMENTS
bool NLOHMANN_JSON_ALLOW_COMMENTS
Definition:
json.cpp:38
fable::parse_json
Json parse_json(InputType &&input)
Definition:
json.hpp:105
fable
include
fable
json.hpp
Generated on Mon Apr 17 2023 08:09:59 for cloe by
1.8.13