Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JsCopyStringOneByte

Limin Zhu edited this pageAug 15, 2017 ·1 revision

Write JS string value into char string buffer without a null terminator

Syntax

CHAKRA_API    JsCopyStringOneByte(        _In_ JsValueRef value,        _In_ int start,        _In_ int length,        _Out_opt_ char* buffer,        _Out_opt_ size_t* written);

Parameters

  • value: JavascriptString value
  • start: Start offset of buffer
  • length: Number of characters to be written
  • buffer: Pointer to buffer
  • written: Total number of characters written

Return Value

The codeJsNoError if the operation succeeded, a failure code otherwise.

Remarks

This API is experimental and may have breaking change later.

When size of thebuffer is unknown,buffer argument can be nullptr. In that case,actualLength argument will return the length needed.

When start is out of range or < 0, returns JsErrorInvalidArgument andwritten will be equal to 0. If calculated length is 0 (It can be due to string length orstart and length combination), thenwritten will be equal to 0 and call returns JsNoError.

The JS stringvalue will be converted one utf16 code point at a time, and if it has code points that do not fit in one byte, those values will be truncated.

Want to contribute to this Wiki?

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp