move sub-functions of value impls to concrete types
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
7536cf4c7c
commit
03c18debec
14 changed files with 339 additions and 119 deletions
|
|
@ -1,5 +1,7 @@
|
|||
#include "ikarus/values/text_value.h"
|
||||
|
||||
#include <boost/functional/overloaded_function.hpp>
|
||||
|
||||
#include <values/text_value.hpp>
|
||||
#include <values/value_base.hpp>
|
||||
|
||||
|
|
@ -30,6 +32,39 @@ void ikarus_text_value_insert(IkarusTextValue * value, size_t idx, char const *
|
|||
return ikarus_value_base_insert(value, idx, new_data);
|
||||
}
|
||||
|
||||
void ikarus_text_value_clear(IkarusTextValue * value) {
|
||||
return ikarus_value_base_clear(value);
|
||||
}
|
||||
|
||||
bool ikarus_text_value_is_undefined(IkarusTextValue const * value) {
|
||||
return ikarus_value_base_is_undefined(value);
|
||||
}
|
||||
|
||||
void ikarus_text_value_set_undefined(IkarusTextValue * value, bool undefined) {
|
||||
return ikarus_value_base_set_undefined(value, undefined);
|
||||
}
|
||||
|
||||
char const * ikarus_text_value_to_string(IkarusTextValue const * value) {
|
||||
return boost::variant2::visit(
|
||||
boost::make_overloaded_function(
|
||||
[](boost::variant2::monostate const&) { return nullptr; }, [](auto const& data) { return fmt::join(data, ", "); }
|
||||
),
|
||||
value->data
|
||||
);
|
||||
}
|
||||
|
||||
bool ikarus_text_value_is_equal(IkarusTextValue const * lhs, IkarusTextValue const * rhs) {
|
||||
return ikarus_value_base_is_equal(lhs, rhs);
|
||||
}
|
||||
|
||||
IkarusTextValue * ikarus_text_value_copy(IkarusTextValue const * value) {
|
||||
return ikarus_value_base_copy(value);
|
||||
}
|
||||
|
||||
struct IkarusValue * ikarus_text_value_to_value(IkarusTextValue * value) {
|
||||
return ikarus_value_base_to_value(value);
|
||||
}
|
||||
|
||||
struct IkarusValue const * ikarus_text_value_to_value_const(IkarusTextValue const * value) {
|
||||
return ikarus_value_base_to_value_const(value);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue