|
Ultralight C API 1.4.0
|
Functions | |
| JSStringRef | JSStringCreateWithCharacters (const JSChar *chars, size_t numChars) |
| Creates a JavaScript string from a buffer of Unicode characters. | |
| JSStringRef | JSStringCreateWithUTF8CString (const char *string) |
| Creates a JavaScript string from a null-terminated UTF8 string. | |
| JSStringRef | JSStringRetain (JSStringRef string) |
| Retains a JavaScript string. | |
| void | JSStringRelease (JSStringRef string) |
| Releases a JavaScript string. | |
| size_t | JSStringGetLength (JSStringRef string) |
| Returns the number of Unicode characters in a JavaScript string. | |
| const JSChar * | JSStringGetCharactersPtr (JSStringRef string) |
| Returns a pointer to the Unicode character buffer that serves as the backing store for a JavaScript string. | |
| size_t | JSStringGetMaximumUTF8CStringSize (JSStringRef string) |
| Returns the maximum number of bytes a JavaScript string will take up if converted into a null-terminated UTF8 string. | |
| size_t | JSStringGetUTF8CString (JSStringRef string, char *buffer, size_t bufferSize) |
| Converts a JavaScript string into a null-terminated UTF8 string, and copies the result into an external byte buffer. | |
| bool | JSStringIsEqual (JSStringRef a, JSStringRef b) |
| Tests whether two JavaScript strings match. | |
| bool | JSStringIsEqualToUTF8CString (JSStringRef a, const char *b) |
| Tests whether a JavaScript string matches a null-terminated UTF8 string. | |
Typedefs | |
| typedef unsigned short | JSChar |
| A UTF-16 code unit. One, or a sequence of two, can encode any Unicode character. As with all scalar types, endianness depends on the underlying architecture. | |
| JSStringRef JSStringCreateWithCharacters | ( | const JSChar * | chars, |
| size_t | numChars ) |
Creates a JavaScript string from a buffer of Unicode characters.
| chars | The buffer of Unicode characters to copy into the new JSString. |
| numChars | The number of characters to copy from the buffer pointed to by chars. |
| JSStringRef JSStringCreateWithUTF8CString | ( | const char * | string | ) |
Creates a JavaScript string from a null-terminated UTF8 string.
| string | The null-terminated UTF8 string to copy into the new JSString. |
| const JSChar * JSStringGetCharactersPtr | ( | JSStringRef | string | ) |
Returns a pointer to the Unicode character buffer that serves as the backing store for a JavaScript string.
| string | The JSString whose backing store you want to access. |
| size_t JSStringGetLength | ( | JSStringRef | string | ) |
Returns the number of Unicode characters in a JavaScript string.
| string | The JSString whose length (in Unicode characters) you want to know. |
| size_t JSStringGetMaximumUTF8CStringSize | ( | JSStringRef | string | ) |
Returns the maximum number of bytes a JavaScript string will take up if converted into a null-terminated UTF8 string.
| string | The JSString whose maximum converted size (in bytes) you want to know. |
| size_t JSStringGetUTF8CString | ( | JSStringRef | string, |
| char * | buffer, | ||
| size_t | bufferSize ) |
Converts a JavaScript string into a null-terminated UTF8 string, and copies the result into an external byte buffer.
| string | The source JSString. |
| buffer | 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 | The size of the external buffer in bytes. |
| bool JSStringIsEqual | ( | JSStringRef | a, |
| JSStringRef | b ) |
Tests whether two JavaScript strings match.
| a | The first JSString to test. |
| b | The second JSString to test. |
| bool JSStringIsEqualToUTF8CString | ( | JSStringRef | a, |
| const char * | b ) |
Tests whether a JavaScript string matches a null-terminated UTF8 string.
| a | The JSString to test. |
| b | The null-terminated UTF8 string to test. |
| void JSStringRelease | ( | JSStringRef | string | ) |
Releases a JavaScript string.
| string | The JSString to release. |
| JSStringRef JSStringRetain | ( | JSStringRef | string | ) |
Retains a JavaScript string.
| string | The JSString to retain. |
| typedef unsigned short JSChar |