libikarus/src/values/text_value.hpp
Folling f847d30c06
implement toggle/number/text values
Signed-off-by: Folling <mail@folling.io>
2025-04-15 12:08:00 +02:00

33 lines
751 B
C++

#pragma once
#include <string>
#include <values/value.hpp>
/// \private
struct IkarusTextValue final : IkarusValue {
public:
explicit IkarusTextValue(std::string value):
IkarusValue{this},
_value(std::move(value)) {}
IkarusTextValue(IkarusTextValue const&) = default;
IkarusTextValue(IkarusTextValue&&) noexcept = default;
IkarusTextValue& operator=(IkarusTextValue const&) = default;
IkarusTextValue& operator=(IkarusTextValue&&) noexcept = default;
~IkarusTextValue() override = default;
public:
[[nodiscard]] std::string_view get_value() const noexcept {
return _value;
}
void set_value(std::string_view value) {
_value = value;
}
private:
std::string _value;
};