napi_get_buffer_string_utf16_in_critical_scope

Function napi_get_buffer_string_utf16_in_critical_scope 

Source
pub unsafe extern "C" fn napi_get_buffer_string_utf16_in_critical_scope(
    env: napi_env,
    value: napi_value,
    buffer: *mut *const char16_t,
    length: *mut usize,
) -> napi_status
Available on crate features napi and api-21 only.
Expand description

To obtain a ArkTS string buffer cache within the critical scope.

§Arguments

  • env - Current running virtual machine context.

  • value - An ArkTS string object which need be encoded with UTF16 format.

  • buffer - String buffer cache of the ArkTS string object value.

  • length - Length size of the string buffer cache which needs to be obtained.

§Returns

  • Returns the function execution status. [napi_ok] If the function executed successfully.

[napi_invalid_arg] If the param env, value, buffer and length is nullptr.

Available since API-level: 21