fx: support for registering callable functions with types
This commit is contained in:
+14
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user