jSStringGetUTF8CString top-level property

int Function(Pointer<NativeType> string, Pointer<NativeType> buffer, int bufferSize) jSStringGetUTF8CString
final

Converts a JavaScript string into a null-terminated UTF8 string, and copies the result into an external byte buffer. string (JSStringRef) The source JSString. buffer (char*) The destination byte buffer into which to copy a null-terminated UTF8 representation of string. On return, buffer contains a UTF8 string representation of string. If bufferSize is too small, buffer will contain only partial results. If buffer is not at least bufferSize bytes in size, behavior is undefined. bufferSize (size_t) The size of the external buffer in bytes. @result (size_t) The number of bytes written into buffer (including the null-terminator byte).

Implementation

final int Function(Pointer string, Pointer buffer, int bufferSize)
    jSStringGetUTF8CString = JscFfi.lib
        .lookup<NativeFunction<Uint32 Function(Pointer, Pointer, Uint32)>>(
            'JSStringGetUTF8CString')
        .asFunction();