libikarus/src/ikarus/values/value.hpp
Folling 195f51d3d0
finalize schema/data setup
Signed-off-by: Folling <mail@folling.io>
2025-04-15 12:08:10 +02:00

28 lines
730 B
C++

#pragma once
#include <nlohmann/json.hpp>
#include <cppbase/result.hpp>
#include <ikarus/values/data.hpp>
#include <ikarus/values/errors.hpp>
#include <ikarus/values/schema.hpp>
struct IkarusValue {
IkarusValueSchema schema;
IkarusValueData data;
static auto from_json(nlohmann::json const & json)
-> cppbase::Result<IkarusValue, IkarusValueParseError>;
static auto to_json(nlohmann::json & json, IkarusValue const & value)
-> void;
};
struct IkarusValues {
static auto from_json(nlohmann::json const & json)
-> cppbase::Result<IkarusValues, IkarusValuesParseError>;
static auto to_json(nlohmann::json & json, IkarusValues const & values)
-> void;
std::vector<std::pair<std::string, IkarusValue>> values;
};