33 lines
802 B
C++
33 lines
802 B
C++
#pragma once
|
|
|
|
#include <variant>
|
|
|
|
#include <boost/json.hpp>
|
|
|
|
#include <cppbase/result.hpp>
|
|
|
|
struct IkarusValue {
|
|
public:
|
|
using Data = std::variant<struct IkarusToggleValue *, struct IkarusNumberValue *, struct IkarusTextValue *>;
|
|
|
|
public:
|
|
explicit IkarusValue(Data data);
|
|
|
|
IkarusValue(IkarusValue const&) = default;
|
|
IkarusValue(IkarusValue&&) noexcept = default;
|
|
|
|
IkarusValue& operator=(IkarusValue const&) = default;
|
|
IkarusValue& operator=(IkarusValue&&) noexcept = default;
|
|
|
|
virtual ~IkarusValue() = default;
|
|
|
|
public:
|
|
struct FromJsonError {};
|
|
|
|
[[nodiscard]] static cppbase::Result<IkarusValue, FromJsonError> from_json(boost::json::value const& json);
|
|
[[nodiscard]] boost::json::value to_json() const;
|
|
|
|
public:
|
|
bool indeterminate{false};
|
|
Data data;
|
|
};
|