SPVM::Document::NativeAPI::BasicType − Basic Type Native APIs
The basic type native APIs in SPVM are the APIs to get definition information for basic types.
int32_t error_id
SPVM_API_BASIC_TYPE* api_basic_type =
env−>api−>basic_type;
void* basic_type = env−>get_basic_type(env, stack,
"Int");
const char* basic_type_name =
api_basic_type−>get_name(env−>runtime,
basic_type);
"const char* (*get_name)(void* runtime, void* basic_type);"
Returns the name of the basic type basic_type.
"int32_t (*get_id)(void* runtime, void* basic_type);"
Returns the ID of the basic type basic_type.
"int32_t (*get_category)(void* runtime, void* basic_type);"
Returns the base type category ID of the basic type basic_type.
"void* (*get_parent)(void* runtime, void* basic_type);"
Returns the parent basic type object of the basic type basic_type.
"const char* (*get_version_string)(void* runtime, void* basic_type);"
Returns the version string of the basic type basic_type.
"const char* (*get_class_dir)(void* runtime, void* basic_type);"
Returns the class directory of the basic type basic_type.
"const char* (*get_class_rel_file)(void* runtime, void* basic_type);"
Returns the class relative file of the basic type basic_type.
"int32_t (*is_pointer)(void* runtime, void* basic_type);"
If the basic type basic_type is a pointer class, returns 1, otherwise returns 0.
"int32_t (*is_anon)(void* runtime, void* basic_type);"
If the basic type basic_type is an anon class, returns 1, otherwise returns 0.
"void* (*get_class_var_by_index)(void* runtime, void* basic_type, int32_t class_var_index);"
Searches a class variable owned by the basic type basic_type given the class variable index class_var_index.
If it is found, returns it. Otherwise, returns "NULL".
"void* (*get_class_var_by_name)(void* runtime, void* basic_type, const char* class_var_name);"
Searches a class variable owned by the basic type basic_type given the class variable name class_var_name.
If it is found, returns it. Otherwise, returns "NULL".
"int32_t (*get_class_vars_length)(void* runtime, void* basic_type);"
Returns the length of the class variables owned by the basic type basic_type.
"void* (*get_field_by_index)(void* runtime, void* basic_type, int32_t field_index);"
Searches a field owned by the basic type basic_type given the field index field_index.
If it is found, returns it. Otherwise, returns "NULL".
"void* (*get_field_by_name)(void* runtime, void* basic_type, const char* field_name);"
Searches a field owned by the basic type basic_type given the field name field_name.
If it is found, returns it. Otherwise, returns "NULL".
"int32_t (*get_fields_length)(void* runtime, void* basic_type);"
Returns the length of the fields owned by the basic type basic_type.
"void* (*get_method_by_index)(void* runtime, void* basic_type, int32_t method_index);"
Searches a method owned by the basic type basic_type given the method index method_index.
If it is found, returns it. Otherwise, returns "NULL".
"void* (*get_method_by_name)(void* runtime, void* basic_type, const char* method_name);"
Searches a method owned by the basic type basic_type given the method name method_name.
If it is found, returns it. Otherwise, returns "NULL".
"int32_t (*get_methods_length)(void* runtime, void* basic_type);"
Returns the length of the methods owned by the basic type basic_type.
"void* (*get_anon_basic_type_by_index)(void* runtime, void* basic_type, int32_t anon_basic_type_index);"
Searches an anon basic type owned by the basic type basic_type given an anon basic type index anon_basic_type_index.
If it is found, returns it. Otherwise, returns "NULL".
"int32_t (*get_anon_basic_types_length)(void* runtime, void* basic_type);"
Returns the length of the anon basic types owned by the basic type basic_type.
"int32_t (*has_interface)(void* runtime, void* basic_type, void* interface_basic_type);"
If the basic type basic_type has an interface interface_basic_type, returns 1, otherwise returns 0.
"int32_t (*is_super_class)(void* runtime, void* dist_basic_type, void* src_basic_type);"
If dist_basic_type is a super class of src_basic_type, returns 1, otherwise returns 0.
"const char* (*get_file)(void* runtime, void* basic_type);"
Returns the file path of the basic type basic_type.
This can be changed by a file directive.
#file
/tempaltes/foo.html.ep
class Foo {
}
"void* (*get_current_runtime)(void* runtime, void* basic_type);"
Returns the runtime that owns the basic type basic_type.
"void* (*get_basic_type_in_version_from)(void* runtime, void* basic_type);"
void* (*get_basic_type_in_version_from)(void* runtime, void* basic_type)
Returns the basic type basic type object specified by "version_from" statement.
int32_t (*get_fields_size)(void* runtime, void* basic_type);
Retunrs the total byte size of the fields.
0 get_name
1 get_id
2 get_category
3 get_parent
4 get_version_string
5 get_class_dir
6 get_class_rel_file
7 is_pointer
8 is_anon
9 get_class_var_by_index
10 get_class_var_by_name
11 get_class_vars_length
12 get_field_by_index
13 get_field_by_name
14 get_fields_length
15 get_method_by_index
16 get_method_by_name
17 get_methods_length
18 get_anon_basic_type_by_index
19 get_anon_basic_types_length
20 has_interface
21 is_super_class
22 get_file
23 get_current_runtime
24 get_basic_type_in_version_from
25 get_fields_size
|
• |
SPVM::Document::NativeAPI |
|||
|
• |
SPVM::Document::NativeAPI::Type |
|||
|
• |
SPVM::Document::NativeClass |
|||
|
• |
SPVM::Document |
Copyright (c) 2023 Yuki Kimoto
MIT License