Skip to content

Commit 20ab0fb

Browse files
doc
1 parent 05317ac commit 20ab0fb

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

doc/api/n-api.md

+90
Original file line numberDiff line numberDiff line change
@@ -2886,6 +2886,36 @@ string. The native string is copied.
28862886
The JavaScript `string` type is described in
28872887
[Section 6.1.4][] of the ECMAScript Language Specification.
28882888

2889+
#### `node_api_create_external_string_latin1`
2890+
2891+
<!-- YAML
2892+
added: REPLACEME
2893+
-->
2894+
2895+
> Stability: 1 - Experimental
2896+
2897+
```c
2898+
napi_status node_api_create_string_latin1(napi_env env,
2899+
const char* str,
2900+
size_t length,
2901+
napi_value* result);
2902+
```
2903+
2904+
* `[in] env`: The environment that the API is invoked under.
2905+
* `[in] str`: Character buffer representing an ISO-8859-1-encoded string.
2906+
* `[in] length`: The length of the string in bytes, or `NAPI_AUTO_LENGTH` if it
2907+
is null-terminated.
2908+
* `[out] result`: A `napi_value` representing a JavaScript `string`.
2909+
2910+
Returns `napi_ok` if the API succeeded.
2911+
2912+
This API creates a JavaScript `string` value from an ISO-8859-1-encoded C
2913+
string. The native string may not be copied and must thus exist for the entire
2914+
life cycle of the JavaScript value.
2915+
2916+
The JavaScript `string` type is described in
2917+
[Section 6.1.4][] of the ECMAScript Language Specification.
2918+
28892919
#### `napi_create_string_utf16`
28902920

28912921
<!-- YAML
@@ -2914,6 +2944,36 @@ The native string is copied.
29142944
The JavaScript `string` type is described in
29152945
[Section 6.1.4][] of the ECMAScript Language Specification.
29162946

2947+
#### `node_api_create_external_string_utf16`
2948+
2949+
<!-- YAML
2950+
added: REPLACEME
2951+
-->
2952+
2953+
> Stability: 1 - Experimental
2954+
2955+
```c
2956+
napi_status node_api_create_string_utf16(napi_env env,
2957+
const char16_t* str,
2958+
size_t length,
2959+
napi_value* result)
2960+
```
2961+
2962+
* `[in] env`: The environment that the API is invoked under.
2963+
* `[in] str`: Character buffer representing a UTF16-LE-encoded string.
2964+
* `[in] length`: The length of the string in two-byte code units, or
2965+
`NAPI_AUTO_LENGTH` if it is null-terminated.
2966+
* `[out] result`: A `napi_value` representing a JavaScript `string`.
2967+
2968+
Returns `napi_ok` if the API succeeded.
2969+
2970+
This API creates a JavaScript `string` value from a UTF16-LE-encoded C string.
2971+
The native string may not be copied and must thus exist for the entire life
2972+
cycle of the JavaScript value.
2973+
2974+
The JavaScript `string` type is described in
2975+
[Section 6.1.4][] of the ECMAScript Language Specification.
2976+
29172977
#### `napi_create_string_utf8`
29182978

29192979
<!-- YAML
@@ -2942,6 +3002,36 @@ The native string is copied.
29423002
The JavaScript `string` type is described in
29433003
[Section 6.1.4][] of the ECMAScript Language Specification.
29443004

3005+
#### `node_api_create_external_string_utf8`
3006+
3007+
<!-- YAML
3008+
added: REPLACEME
3009+
-->
3010+
3011+
> Stability: 1 - Experimental
3012+
3013+
```c
3014+
napi_status node_api_create_string_utf8(napi_env env,
3015+
const char* str,
3016+
size_t length,
3017+
napi_value* result)
3018+
```
3019+
3020+
* `[in] env`: The environment that the API is invoked under.
3021+
* `[in] str`: Character buffer representing a UTF8-encoded string.
3022+
* `[in] length`: The length of the string in bytes, or `NAPI_AUTO_LENGTH` if it
3023+
is null-terminated.
3024+
* `[out] result`: A `napi_value` representing a JavaScript `string`.
3025+
3026+
Returns `napi_ok` if the API succeeded.
3027+
3028+
This API creates a JavaScript `string` value from a UTF8-encoded C string.
3029+
The native string may not be copied and must thus exist for the entire life
3030+
cycle of the JavaScript value.
3031+
3032+
The JavaScript `string` type is described in
3033+
[Section 6.1.4][] of the ECMAScript Language Specification.
3034+
29453035
### Functions to convert from Node-API to C types
29463036

29473037
#### `napi_get_array_length`

0 commit comments

Comments
 (0)