MantisBase v0.4.9
Loading...
Searching...
No Matches
script_json.h
Go to the documentation of this file.
1
10
11#ifndef MANTISBASE_SCRIPTING_SCRIPT_JSON_H
12#define MANTISBASE_SCRIPTING_SCRIPT_JSON_H
13
14#include <nlohmann/json.hpp>
15#include <type_traits>
16#include <utility>
17
18namespace mb {
19 struct MbScriptJson {
20 nlohmann::json value;
21
22 MbScriptJson() = default;
23 MbScriptJson(const MbScriptJson &) = default;
24 MbScriptJson(MbScriptJson &&) noexcept = default;
25 MbScriptJson &operator=(const MbScriptJson &) = default;
26 MbScriptJson &operator=(MbScriptJson &&) noexcept = default;
27
28 template<typename T, typename = std::enable_if_t<std::is_same_v<std::decay_t<T>, nlohmann::json>>>
29 explicit MbScriptJson(T &&json) : value(std::forward<T>(json)) {}
30 };
31}
32
33#endif
Definition api_keys.h:35
nlohmann::json json
Shorten JSON namespace.
Definition api_keys.h:36
Definition utils.h:35
MbScriptJson()=default
nlohmann::json value
Definition script_json.h:20
MbScriptJson(MbScriptJson &&) noexcept=default
MbScriptJson(const MbScriptJson &)=default