Skip to content

Commit 290a5ab

Browse files
tniessentargos
authored andcommitted
doc: clarify napi_get_value_string_* for bufsize 0
PR-URL: #58158 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent b66f1b0 commit 290a5ab

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/api/n-api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3689,6 +3689,8 @@ napi_status napi_get_value_string_latin1(napi_env env,
36893689
is returned in `result`.
36903690
* `[in] bufsize`: Size of the destination buffer. When this value is
36913691
insufficient, the returned string is truncated and null-terminated.
3692+
If this value is zero, then the string is not returned and no changes are done
3693+
to the buffer.
36923694
* `[out] result`: Number of bytes copied into the buffer, excluding the null
36933695
terminator.
36943696

@@ -3720,6 +3722,8 @@ napi_status napi_get_value_string_utf8(napi_env env,
37203722
returned in `result`.
37213723
* `[in] bufsize`: Size of the destination buffer. When this value is
37223724
insufficient, the returned string is truncated and null-terminated.
3725+
If this value is zero, then the string is not returned and no changes are done
3726+
to the buffer.
37233727
* `[out] result`: Number of bytes copied into the buffer, excluding the null
37243728
terminator.
37253729

@@ -3750,6 +3754,8 @@ napi_status napi_get_value_string_utf16(napi_env env,
37503754
null terminator is returned.
37513755
* `[in] bufsize`: Size of the destination buffer. When this value is
37523756
insufficient, the returned string is truncated and null-terminated.
3757+
If this value is zero, then the string is not returned and no changes are done
3758+
to the buffer.
37533759
* `[out] result`: Number of 2-byte code units copied into the buffer, excluding
37543760
the null terminator.
37553761

0 commit comments

Comments
 (0)