ADC Home > Reference Library > Reference > Carbon > Internet & Web > JavaScriptCore Framework Reference
|
JSStringRef.h |
Includes: |
JSStringCreateWithCharacters |
Creates a JavaScript string from a buffer of Unicode characters.
JSStringRef JSStringCreateWithCharacters( const JSChar *chars, size_t numChars);
chars
numChars
A JSString containing chars. Ownership follows the Create Rule.
JSStringCreateWithUTF8CString |
Creates a JavaScript string from a null-terminated UTF8 string.
JSStringRef JSStringCreateWithUTF8CString( const char *string);
string
A JSString containing string. Ownership follows the Create Rule.
JSStringGetCharactersPtr |
Returns a pointer to the Unicode character buffer that serves as the backing store for a JavaScript string.
const JSChar* JSStringGetCharactersPtr( JSStringRef string);
string
A pointer to the Unicode character buffer that serves as string's backing store, which will be deallocated when string is deallocated.
JSStringGetLength |
Returns the number of Unicode characters in a JavaScript string.
size_t JSStringGetLength( JSStringRef string);
string
The number of Unicode characters stored in string.
JSStringGetMaximumUTF8CStringSize |
Returns the maximum number of bytes a JavaScript string will take up if converted into a null-terminated UTF8 string.
size_t JSStringGetMaximumUTF8CStringSize( JSStringRef string);
string
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.
JSStringGetUTF8CString |
Converts a JavaScript string into a null-terminated UTF8 string, and copies the result into an external byte buffer.
size_t JSStringGetUTF8CString( JSStringRef string, char *buffer, size_t bufferSize);
string
buffer
bufferSize
The number of bytes written into buffer (including the null-terminator byte).
JSStringIsEqual |
Tests whether two JavaScript strings match.
bool JSStringIsEqual( JSStringRef a, JSStringRef b);
a
b
true if the two strings match, otherwise false.
JSStringIsEqualToUTF8CString |
Tests whether a JavaScript string matches a null-terminated UTF8 string.
bool JSStringIsEqualToUTF8CString( JSStringRef a, const char *b);
a
b
true if the two strings match, otherwise false.
JSStringRelease |
Releases a JavaScript string.
void JSStringRelease( JSStringRef string);
string
JSStringRetain |
Retains a JavaScript string.
JSStringRef JSStringRetain( JSStringRef string);
string
A JSString that is the same as string.
JSChar |
A Unicode character.
typedef unsigned short JSChar;
|