SPVM::Document::NativeAPI::StringBuffer − String Buffer Native APIs
The string buffer native APIs in SPVM are the APIs for string buffers
SPVM_API_STRING_BUFFER*
string_buffer_api =
env−>api−>string_buffer;
SPVM_API_ALLOCATOR* api_allocator =
env−>api−>allocator;
void* allocator = api_allocator−>new_instance();
int32_t capacity = 100;
void* string_buffer =
string_buffer_api−>new_instance(allocator,
capacity);
string_buffer_api−>free_instance(string_buffer);
api_allocator−>free_instance(allocator);
"void* (*new_instance)(void* allocator, int32_t capacity);"
Creates a new string buffer given its capacity capacity, and returns it.
"void (*free_instance)(void* string_buffer);"
Frees the string buffer string_buffer.
"const char* (*get_string)(void* string_buffer);"
Returns the string stored in the string buffer string_buffer.
"int32_t (*get_length)(void* string_buffer);"
Returns the length of the string stored in the string buffer string_buffer.
0 new_instance
1 free_instance
2 get_string
3 get_length
|
• |
SPVM::Document::NativeAPI |
|||
|
• |
SPVM::Document::NativeAPI::Allocator |
|||
|
• |
SPVM::Document::NativeClass |
|||
|
• |
SPVM::Document |
Copyright (c) 2023 Yuki Kimoto
MIT License