Ignore:
Timestamp:
Jul 10, 2006, 10:41:32 AM (19 years ago)
Author:
ggaren
Message:

Approved by Maciej, Darin.


Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
JavaScript engine's internal string representation, which is the most
low-level and efficient representation to use when interfacing with JavaScript.

  • API/APICast.h: (toJS): (toRef):
  • API/JSBase.h:
  • API/JSCallbackObject.cpp: (KJS::JSCallbackObject::getOwnPropertySlot): (KJS::JSCallbackObject::put): (KJS::JSCallbackObject::deleteProperty): (KJS::JSCallbackObject::staticValueGetter): (KJS::JSCallbackObject::callbackGetter):
  • API/JSContextRef.cpp: (JSEvaluate): (JSCheckSyntax):
  • API/JSContextRef.h:
  • API/JSInternalStringRef.cpp: Added. (JSStringMake): (JSInternalStringCreate): (JSInternalStringCreateUTF8): (JSInternalStringRetain): (JSInternalStringRelease): (JSValueCopyStringValue): (JSInternalStringGetLength): (JSInternalStringGetCharactersPtr): (JSInternalStringGetCharacters): (JSInternalStringGetMaxLengthUTF8): (JSInternalStringGetCharactersUTF8): (JSInternalStringIsEqual): (JSInternalStringIsEqualUTF8): (JSInternalStringCreateCF): (CFStringCreateWithJSInternalString):
  • API/JSInternalStringRef.h: Added.
  • API/JSNode.c: (JSNodePrototype_appendChild): (JSNode_getNodeType): (JSNode_getChildNodes): (JSNode_getFirstChild):
  • API/JSNodeList.c: (JSNodeList_length): (JSNodeList_getProperty):
  • API/JSObjectRef.cpp: (JSFunctionMakeWithBody): (JSObjectGetDescription): (JSObjectHasProperty): (JSObjectGetProperty): (JSObjectSetProperty): (JSObjectDeleteProperty): (JSPropertyEnumeratorGetNext): (JSPropertyListAdd):
  • API/JSObjectRef.h:
  • API/JSStringBufferRef.cpp: Removed.
  • API/JSStringBufferRef.h: Removed.
  • API/JSValueRef.h:
  • API/JavaScriptCore.h:
  • API/minidom.c: (main): (print):
  • API/testapi.c: (assertEqualsAsUTF8String): (assertEqualsAsCharactersPtr): (assertEqualsAsCharacters): (MyObject_hasProperty): (MyObject_getProperty): (MyObject_setProperty): (MyObject_deleteProperty): (MyObject_getPropertyList): (print_callAsFunction): (myConstructor_callAsConstructor): (main):
  • JavaScriptCore.exp:
  • JavaScriptCore.xcodeproj/project.pbxproj:
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSInternalStringRef.h

    r15286 r15307  
    2525 */
    2626
    27 #ifndef JSStringBufferRef_h
    28 #define JSStringBufferRef_h
     27#ifndef JSInternalStringRef_h
     28#define JSInternalStringRef_h
    2929
    3030#include "JSValueRef.h"
     
    4545/*!
    4646@function
    47 @abstract         Creates a JavaScript string buffer from a buffer of Unicode characters.
    48 @param chars      The buffer of Unicode characters to copy into the new JSStringBuffer.
     47@abstract         Creates a JavaScript string from a buffer of Unicode characters.
     48@param chars      The buffer of Unicode characters to copy into the new JSInternalString.
    4949@param numChars   The number of characters to copy from the buffer pointed to by chars.
    50 @result           A JSStringBuffer containing chars. Ownership follows the create rule.
     50@result           A JSInternalString containing chars. Ownership follows the create rule.
    5151*/
    52 JSStringBufferRef JSStringBufferCreate(const JSChar* chars, size_t numChars);
     52JSInternalStringRef JSInternalStringCreate(const JSChar* chars, size_t numChars);
    5353/*!
    5454@function
    55 @abstract         Creates a JavaScript string buffer from a null-terminated UTF8 string.
    56 @param string     The null-terminated UTF8 string to copy into the new JSStringBuffer.
    57 @result           A JSStringBuffer containing string. Ownership follows the create rule.
     55@abstract         Creates a JavaScript string from a null-terminated UTF8 string.
     56@param string     The null-terminated UTF8 string to copy into the new JSInternalString.
     57@result           A JSInternalString containing string. Ownership follows the create rule.
    5858*/
    59 JSStringBufferRef JSStringBufferCreateUTF8(const char* string);
     59JSInternalStringRef JSInternalStringCreateUTF8(const char* string);
    6060
    6161/*!
    6262@function
    63 @abstract         Retains a JavaScript string buffer.
    64 @param buffer     The JSStringBuffer to retain.
    65 @result           A JSStringBuffer that is the same as buffer.
     63@abstract         Retains a JavaScript string.
     64@param buffer     The JSInternalString to retain.
     65@result           A JSInternalString that is the same as buffer.
    6666*/
    67 JSStringBufferRef JSStringBufferRetain(JSStringBufferRef buffer);
     67JSInternalStringRef JSInternalStringRetain(JSInternalStringRef buffer);
    6868/*!
    6969@function
    70 @abstract         Releases a JavaScript string buffer.
    71 @param buffer     The JSStringBuffer to release.
     70@abstract         Releases a JavaScript string.
     71@param buffer     The JSInternalString to release.
    7272*/
    73 void JSStringBufferRelease(JSStringBufferRef buffer);
     73void JSInternalStringRelease(JSInternalStringRef buffer);
    7474
    7575/*!
    7676@function
    77 @abstract         Returns the number of Unicode characters in a JavaScript string buffer.
    78 @param buffer     The JSStringBuffer whose length (in Unicode characters) you want to know.
     77@abstract         Returns the number of Unicode characters in a JavaScript string.
     78@param buffer     The JSInternalString whose length (in Unicode characters) you want to know.
    7979@result           The number of Unicode characters stored in buffer.
    8080*/
    81 size_t JSStringBufferGetLength(JSStringBufferRef buffer);
     81size_t JSInternalStringGetLength(JSInternalStringRef buffer);
    8282/*!
    8383@function
    8484@abstract         Quickly obtains a pointer to the Unicode character buffer that
    85  serves as the backing store for a JavaScript string buffer.
    86 @param buffer     The JSStringBuffer whose backing store you want to access.
     85 serves as the backing store for a JavaScript string.
     86@param buffer     The JSInternalString whose backing store you want to access.
    8787@result           A pointer to the Unicode character buffer that serves as buffer's
    8888 backing store, which will be deallocated when buffer is deallocated.
    8989*/
    90 const JSChar* JSStringBufferGetCharactersPtr(JSStringBufferRef buffer);
     90const JSChar* JSInternalStringGetCharactersPtr(JSInternalStringRef buffer);
    9191/*!
    9292@function
    93 @abstract         Copies a JavaScript string buffer's Unicode characters into an
     93@abstract         Copies a JavaScript string's Unicode characters into an
    9494 external character buffer.
    95 @param inBuffer   The source JSStringBuffer.
     95@param inBuffer   The source JSInternalString.
    9696@param outBuffer  The destination JSChar buffer into which to copy inBuffer's
    9797 characters. On return, outBuffer contains the requested Unicode characters.
    9898@param numChars   The number of Unicode characters to copy. This number must not
    99  exceed the length of the string buffer.
     99 exceed the length of the string.
    100100*/
    101 void JSStringBufferGetCharacters(JSStringBufferRef inBuffer, JSChar* outBuffer, size_t numChars);
     101void JSInternalStringGetCharacters(JSInternalStringRef inBuffer, JSChar* outBuffer, size_t numChars);
    102102
    103103/*!
    104104@function
    105105@abstract         Returns the maximum number of bytes required to encode the
    106  contents of a JavaScript string buffer as a null-terminated UTF8 string.
    107 @param buffer     The JSStringBuffer whose maximum encoded length (in bytes) you
     106 contents of a JavaScript string as a null-terminated UTF8 string.
     107@param buffer     The JSInternalString whose maximum encoded length (in bytes) you
    108108 want to know.
    109109@result           The maximum number of bytes required to encode buffer's contents
    110110 as a null-terminated UTF8 string.
    111111*/
    112 size_t JSStringBufferGetMaxLengthUTF8(JSStringBufferRef buffer);
     112size_t JSInternalStringGetMaxLengthUTF8(JSInternalStringRef buffer);
    113113/*!
    114114@function
    115 @abstract         Converts a JavaScript string buffer's contents into a
     115@abstract         Converts a JavaScript string's contents into a
    116116 null-terminated UTF8 string, and copies the result into an external byte buffer.
    117 @param inBuffer   The source JSStringBuffer.
     117@param inBuffer   The source JSInternalString.
    118118@param outBuffer  The destination byte buffer into which to copy a UTF8 string
    119119 representation of inBuffer. The buffer must be at least bufferSize bytes in length.
     
    123123@result           The number of bytes written into outBuffer (including the null-terminator byte).
    124124*/
    125 size_t JSStringBufferGetCharactersUTF8(JSStringBufferRef inBuffer, char* outBuffer, size_t bufferSize);
     125size_t JSInternalStringGetCharactersUTF8(JSInternalStringRef inBuffer, char* outBuffer, size_t bufferSize);
    126126
    127127/*!
    128128@function
    129 @abstract     Tests whether the characters in two JavaScript string buffers match.
    130 @param a      The first JSStringBuffer to test.
    131 @param b      The second JSStringBuffer to test.
     129@abstract     Tests whether the characters in two JavaScript strings match.
     130@param a      The first JSInternalString to test.
     131@param b      The second JSInternalString to test.
    132132@result       true if the characters in the two buffers match, otherwise false.
    133133*/
    134 bool JSStringBufferIsEqual(JSStringBufferRef a, JSStringBufferRef b);
     134bool JSInternalStringIsEqual(JSInternalStringRef a, JSInternalStringRef b);
    135135/*!
    136136@function
    137 @abstract     Tests whether the characters in a JavaScript string buffer match
     137@abstract     Tests whether the characters in a JavaScript string match
    138138 the characters in a null-terminated UTF8 string.
    139 @param a      The JSStringBuffer to test.
     139@param a      The JSInternalString to test.
    140140@param b      The null-terminated UTF8 string to test.
    141141@result       true if the characters in the two buffers match, otherwise false.
    142142*/
    143 bool JSStringBufferIsEqualUTF8(JSStringBufferRef a, const char* b);
     143bool JSInternalStringIsEqualUTF8(JSInternalStringRef a, const char* b);
    144144
    145145#if defined(__APPLE__)
     
    148148/*!
    149149@function
    150 @abstract         Creates a JavaScript string buffer from a CFString.
     150@abstract         Creates a JavaScript string from a CFString.
    151151@discussion       This function is optimized to take advantage of cases when
    152152 CFStringGetCharactersPtr returns a valid pointer.
    153 @param string     The CFString to copy into the new JSStringBuffer.
    154 @result           A JSStringBuffer containing string. Ownership follows the create rule.
     153@param string     The CFString to copy into the new JSInternalString.
     154@result           A JSInternalString containing string. Ownership follows the create rule.
    155155*/
    156 JSStringBufferRef JSStringBufferCreateCF(CFStringRef string);
     156JSInternalStringRef JSInternalStringCreateCF(CFStringRef string);
    157157/*!
    158158@function
    159 @abstract         Creates a CFString form a JavaScript string buffer.
     159@abstract         Creates a CFString form a JavaScript string.
    160160@param alloc      The alloc parameter to pass to CFStringCreate.
    161 @param buffer     The JSStringBuffer to copy into the new CFString.
     161@param buffer     The JSInternalString to copy into the new CFString.
    162162@result           A CFString containing buffer. Ownership follows the create rule.
    163163*/
    164 CFStringRef CFStringCreateWithJSStringBuffer(CFAllocatorRef alloc, JSStringBufferRef buffer);
     164CFStringRef CFStringCreateWithJSInternalString(CFAllocatorRef alloc, JSInternalStringRef buffer);
    165165#endif // __APPLE__
    166166   
     
    169169#endif
    170170
    171 #endif // JSStringBufferRef_h
     171#endif // JSInternalStringRef_h
Note: See TracChangeset for help on using the changeset viewer.