diff options
author | Daniel Taveras <Daniel_Taveras@condenast.com> | 2017-07-27 21:05:01 -0400 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2018-04-16 17:46:04 -0400 |
commit | a766802bee21a1ae1160da67aa1758073ac27fba (patch) | |
tree | bf1003c1f964dc1959123ba2f93d2da2020f5a3c | |
parent | 73cc251f50453a7d1d89a1f1506c9a5a629def5a (diff) | |
download | node-new-a766802bee21a1ae1160da67aa1758073ac27fba.tar.gz |
doc: fix doc for napi_get_value_string_utf8
The API for napi_get_value_string_utf8() appears to have been
previously changed. This improves the doc reflect the current design.
Backport-PR-URL: https://github.com/nodejs/node/pull/19447
PR-URL: https://github.com/nodejs/node/pull/14529
Fixes: https://github.com/nodejs/node/issues/14398
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
-rw-r--r-- | doc/api/n-api.md | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md index be06a5ab3b..89aa08a151 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -1811,10 +1811,10 @@ NAPI_EXTERN napi_status napi_get_value_string_latin1(napi_env env, - `[in] value`: `napi_value` representing JavaScript string. - `[in] buf`: Buffer to write the ISO-8859-1-encoded string into. If NULL is passed in, the length of the string (in bytes) is returned. -- `[in] bufsize`: Size of the destination buffer. -- `[out] result`: Number of bytes copied into the buffer including the null -terminator. If the buffer size is insufficient, the string will be truncated -including a null terminator. +- `[in] bufsize`: Size of the destination buffer. When this value is +insufficient, the returned string will be truncated. +- `[out] result`: Number of bytes copied into the buffer, excluding the null +terminator. Returns `napi_ok` if the API succeeded. If a non-String `napi_value` is passed in it returns `napi_string_expected`. @@ -1837,11 +1837,11 @@ napi_status napi_get_value_string_utf8(napi_env env, - `[in] env`: The environment that the API is invoked under. - `[in] value`: `napi_value` representing JavaScript string. - `[in] buf`: Buffer to write the UTF8-encoded string into. If NULL is passed -in, the length of the string (in bytes) is returned. -- `[in] bufsize`: Size of the destination buffer. -- `[out] result`: Number of bytes copied into the buffer including the null -terminator. If the buffer size is insufficient, the string will be truncated -including a null terminator. + in, the length of the string (in bytes) is returned. +- `[in] bufsize`: Size of the destination buffer. When this value is +insufficient, the returned string will be truncated. +- `[out] result`: Number of bytes copied into the buffer, excluding the null +terminator. Returns `napi_ok` if the API succeeded. If a non-String `napi_value` is passed in it returns `napi_string_expected`. @@ -1864,10 +1864,10 @@ napi_status napi_get_value_string_utf16(napi_env env, - `[in] value`: `napi_value` representing JavaScript string. - `[in] buf`: Buffer to write the UTF16-LE-encoded string into. If NULL is passed in, the length of the string (in 2-byte code units) is returned. -- `[in] bufsize`: Size of the destination buffer. -- `[out] result`: Number of 2-byte code units copied into the buffer including -the null terminator. If the buffer size is insufficient, the string will be -truncated including a null terminator. +- `[in] bufsize`: Size of the destination buffer. When this value is +insufficient, the returned string will be truncated. +- `[out] result`: Number of 2-byte code units copied into the buffer, excluding the null +terminator. Returns `napi_ok` if the API succeeded. If a non-String `napi_value` is passed in it returns `napi_string_expected`. |