GeezerVison is showing github.com — doc: clarify napi_get_value_string_* for bufsize 0 · nodejs/node@290a5ab
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/n-api.md +6Lines changed: 6 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3689,6 +3689,8 @@ napi_status napi_get_value_string_latin1(napi_env env, |
3689 | 3689 | is returned in `result`. |
3690 | 3690 | * `[in] bufsize`: Size of the destination buffer. When this value is |
3691 | 3691 | 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. |
3692 | 3694 | * `[out] result`: Number of bytes copied into the buffer, excluding the null |
3693 | 3695 | terminator. |
3694 | 3696 |
|
@@ -3720,6 +3722,8 @@ napi_status napi_get_value_string_utf8(napi_env env, |
3720 | 3722 | returned in `result`. |
3721 | 3723 | * `[in] bufsize`: Size of the destination buffer. When this value is |
3722 | 3724 | 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. |
3723 | 3727 | * `[out] result`: Number of bytes copied into the buffer, excluding the null |
3724 | 3728 | terminator. |
3725 | 3729 |
|
@@ -3750,6 +3754,8 @@ napi_status napi_get_value_string_utf16(napi_env env, |
3750 | 3754 | null terminator is returned. |
3751 | 3755 | * `[in] bufsize`: Size of the destination buffer. When this value is |
3752 | 3756 | 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. |
3753 | 3759 | * `[out] result`: Number of 2-byte code units copied into the buffer, excluding |
3754 | 3760 | the null terminator. |
3755 | 3761 |
|
|