The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Name

SPVM::Document::NativeAPI::StringBuffer - String Buffer Native APIs

Description

The string buffer native APIs of SPVM are the APIs to manipulate string buffers

Usage

  SPVM_API_STRING_BUFFER* string_buffer_api = env->api->string_buffer;
  
  void* string_buffer = string_buffer_api->new_instance();
  
  string_buffer_api->free_instance(string_buffer);

Native APIs

new_instance

  void* (*new_instance)(void* allocator, int32_t capacity);

Creates a new string buffer object and returns it.

The allocator argument is an allocator object.

The capacity argument is the capacity of the string buffer.

free_instance

  void (*free_instance)(void* string_buffer);

Frees a string buffer object.

get_string

  const char* (*get_string)(void* string_buffer);

Gets the string in the string buffer object.

get_length

  int32_t (*get_length)(void* string_buffer);

Gets the length of the string in the string buffer object.

Native API IDs

  0 new_instance
  1 free_instance
  2 get_string
  3 get_length

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License