js_string_ref library

Properties

jSStringCreateWithCharacters → Pointer<NativeType> Function(Pointer<Pointer<NativeType>> chars, Pointer<NativeType> numChars)
Creates a JavaScript string from a buffer of Unicode characters. chars (JSChar*) The buffer of Unicode characters to copy into the new JSString. numChars (size_t) The number of characters to copy from the buffer pointed to by chars. @result (JSStringRef) A JSString containing chars. Ownership follows the Create Rule.
final
jSStringCreateWithUTF8CString → Pointer<NativeType> Function(Pointer<Utf8> string)
Creates a JavaScript string from a null-terminated UTF8 string. string (char*) The null-terminated UTF8 string to copy into the new JSString. @result (JSStringRef) A JSString containing string. Ownership follows the Create Rule.
final
jSStringGetCharactersPtr → Pointer<Utf16> Function(Pointer<NativeType> string)
Returns a pointer to the Unicode character buffer that serves as the backing store for a JavaScript string. string (JSStringRef) The JSString whose backing store you want to access. @result (const JSChar*) A pointer to the Unicode character buffer that serves as string's backing store, which will be deallocated when string is deallocated.
final
jSStringGetLength → int Function(Pointer<NativeType> string)
Returns the number of Unicode characters in a JavaScript string. string (JSStringRef) The JSString whose length (in Unicode characters) you want to know. @result (size_t) The number of Unicode characters stored in string.
final
jSStringGetMaximumUTF8CStringSize → int Function(Pointer<NativeType> string)
Returns the maximum number of bytes a JavaScript string will take up if converted into a null-terminated UTF8 string. string (JSStringRef) The JSString whose maximum converted size (in bytes) you want to know. @result (size_t) The maximum number of bytes that could be required to convert string into a null-terminated UTF8 string. The number of bytes that the conversion actually ends up requiring could be less than this, but never more.
final
jSStringGetUTF8CString → int Function(Pointer<NativeType> string, Pointer<NativeType> buffer, int bufferSize)
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).
final
jSStringIsEqual → int Function(Pointer<NativeType> a, Pointer<NativeType> b)
Tests whether two JavaScript strings match. a (JSStringRef) The first JSString to test. b (JSStringRef) The second JSString to test. @result (bool) true if the two strings match, otherwise false.
final
jSStringIsEqualToUTF8CString → Pointer<NativeType> Function(Pointer<NativeType> a, Pointer<NativeType> b)
Tests whether a JavaScript string matches a null-terminated UTF8 string. a (JSStringRef) The JSString to test. b (char*) The null-terminated UTF8 string to test. @result (bool) true if the two strings match, otherwise false.
final
jSStringRelease → void Function(Pointer<NativeType> string)
Releases a JavaScript string. string (JSStringRef) The JSString to release.
final
jSStringRetain → Pointer<NativeType> Function(Pointer<NativeType> string)
Retains a JavaScript string. string (JSStringRef) The JSString to retain. @result (JSStringRef) A JSString that is the same as string.
final