implement toggle/number/text values
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
ea221cdf85
commit
ff9bf0c14a
14 changed files with 280 additions and 48 deletions
|
|
@ -2,7 +2,32 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include <values/value.hpp>
|
||||
|
||||
/// \private
|
||||
struct IkarusTextValue {
|
||||
std::string value;
|
||||
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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue