Loading...
Searching...
No Matches
ParametersJSON.h
Go to the documentation of this file.
1/*
2** This file is part of eOn.
3**
4** SPDX-License-Identifier: BSD-3-Clause
5**
6** Copyright (c) 2010--present, eOn Development Team
7** All rights reserved.
8**
9** Repo:
10** https://github.com/TheochemUI/eOn
11*/
12#pragma once
13
14#include <nlohmann/json.hpp>
15#include <string>
16#include <string_view>
17
18namespace eonc {
19
20class Parameters;
21
22namespace config {
23
25nlohmann::json to_json(const Parameters &params);
26
28void from_json(const nlohmann::json &j, Parameters &params);
29
31int load_json(std::string_view json_str, Parameters &params);
32
33} // namespace config
34} // namespace eonc
void from_json(const json &j, Parameters &p)
Deserialize JSON into Parameters, then resolve computed fields.
int load_json(std::string_view json_str, Parameters &params)
Load Parameters from a JSON string. Returns 0 on success.
json to_json(const Parameters &p)
Serialize all Parameters to JSON.
RAII resource manager for the ARTn C library with global synchronization.