fx: support for registering callable functions with types

This commit is contained in:
2026-05-05 21:16:31 +01:00
parent 703155affe
commit f3062222cb
16 changed files with 182 additions and 25 deletions
+14
View File
@@ -1,4 +1,5 @@
#include <ctype.h>
#include <fx/reflection/function.h>
#include <fx/stream.h>
#include <fx/string.h>
#include <fx/stringstream.h>
@@ -1716,6 +1717,19 @@ FX_TYPE_CLASS_BEGIN(fx_string)
FX_INTERFACE_ENTRY(it_begin) = iterator_begin;
FX_INTERFACE_ENTRY(it_cbegin) = iterator_cbegin;
FX_TYPE_VTABLE_INTERFACE_END(fx_iterable, FX_TYPE_ITERABLE)
FX_TYPE_CONSTRUCTOR("create", fx_string_create, 0, FX_VALUE_TYPE_NONE);
FX_TYPE_CONSTRUCTOR(
"create_from_cstr",
fx_string_create_from_cstr,
1,
FX_VALUE_TYPE_CSTR);
FX_TYPE_METHOD(
FX_VALUE_TYPE_CSTR,
"get_cstr",
fx_string_get_cstr,
0,
FX_VALUE_TYPE_POINTER);
FX_TYPE_CLASS_END(fx_string)
FX_TYPE_DEFINITION_BEGIN(fx_string)