napi_get_value_string_latin1

Function napi_get_value_string_latin1 

Source
pub unsafe extern "C" fn napi_get_value_string_latin1(
    env: napi_env,
    value: napi_value,
    buf: *mut c_char,
    bufsize: usize,
    result: *mut usize,
) -> napi_status
Available on crate feature napi only.
Expand description

Obtains the ISO-8859-1-encoded string corresponding to the given ArkTS value.

§Arguments

  • env - Current running virtual machine context.

  • value - ArkTS string.

  • buf - Destination buffer that will be filled with the provided ISO-8859-1-encoded string.

  • bufsize - The size of the buffer ‘buf’.

  • result - The length of the string in ISO-8859-1-encoded format.

§Returns

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

[napi_invalid_arg] If the param env and(or) value is nullptr;

If the param buf and result both are nullptr.

[napi_string_expected] If a non-string ArkTS value passed in it.

Available since API-level: 10