JSStringRef.h

A UTF16 character buffer that is the fundamental string representation in JavaScript.

Topics

Functions

func JSStringCreateWithCharacters(UnsafePointer<JSChar>!, Int) -> JSStringRef!

Creates a JavaScript string from a buffer of Unicode characters.

func JSStringCreateWithUTF8CString(UnsafePointer<Int8>!) -> JSStringRef!

Creates a JavaScript string from a null-terminated UTF8 string.

func JSStringGetCharactersPtr(JSStringRef!) -> UnsafePointer<JSChar>!

Returns a pointer to the Unicode character buffer that serves as the backing store for a JavaScript string.

func JSStringGetLength(JSStringRef!) -> Int

Returns the number of Unicode characters in a JavaScript string.

func JSStringGetMaximumUTF8CStringSize(JSStringRef!) -> Int

Returns the maximum number of bytes a JavaScript string will take up if converted into a null-terminated UTF8 string.

func JSStringGetUTF8CString(JSStringRef!, UnsafeMutablePointer<Int8>!, Int) -> Int

Converts a JavaScript string into a null-terminated UTF8 string, and copies the result into an external byte buffer.

func JSStringIsEqual(JSStringRef!, JSStringRef!) -> Bool

Tests whether two JavaScript strings match.

func JSStringIsEqualToUTF8CString(JSStringRef!, UnsafePointer<Int8>!) -> Bool

Tests whether a JavaScript string matches a null-terminated UTF8 string.

func JSStringRelease(JSStringRef!)

Releases a JavaScript string.

Data Types

See the Overview section above for header-level documentation.

typealias JSChar

A Unicode character.

See Also

Legacy JavaScriptCore APIs

JSBase.h

Defines the JavaScriptCore interface engine.

JSObjectRef.h

A JavaScript Object.

JSStringRefCF.h

Contains CFString convenience methods.

JSValueRef.h

A JavaScript value that is the base type for all JavaScript values and the polymorphic functions on them.