Changeset 15307 in webkit for trunk/JavaScriptCore/API/JSInternalStringRef.h
- Timestamp:
- Jul 10, 2006, 10:41:32 AM (19 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSInternalStringRef.h
r15286 r15307 25 25 */ 26 26 27 #ifndef JS StringBufferRef_h28 #define JS StringBufferRef_h27 #ifndef JSInternalStringRef_h 28 #define JSInternalStringRef_h 29 29 30 30 #include "JSValueRef.h" … … 45 45 /*! 46 46 @function 47 @abstract Creates a JavaScript string bufferfrom a buffer of Unicode characters.48 @param chars The buffer of Unicode characters to copy into the new JS StringBuffer.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. 49 49 @param numChars The number of characters to copy from the buffer pointed to by chars. 50 @result A JS StringBuffercontaining chars. Ownership follows the create rule.50 @result A JSInternalString containing chars. Ownership follows the create rule. 51 51 */ 52 JS StringBufferRef JSStringBufferCreate(const JSChar* chars, size_t numChars);52 JSInternalStringRef JSInternalStringCreate(const JSChar* chars, size_t numChars); 53 53 /*! 54 54 @function 55 @abstract Creates a JavaScript string bufferfrom a null-terminated UTF8 string.56 @param string The null-terminated UTF8 string to copy into the new JS StringBuffer.57 @result A JS StringBuffercontaining 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. 58 58 */ 59 JS StringBufferRef JSStringBufferCreateUTF8(const char* string);59 JSInternalStringRef JSInternalStringCreateUTF8(const char* string); 60 60 61 61 /*! 62 62 @function 63 @abstract Retains a JavaScript string buffer.64 @param buffer The JS StringBufferto retain.65 @result A JS StringBufferthat 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. 66 66 */ 67 JS StringBufferRef JSStringBufferRetain(JSStringBufferRef buffer);67 JSInternalStringRef JSInternalStringRetain(JSInternalStringRef buffer); 68 68 /*! 69 69 @function 70 @abstract Releases a JavaScript string buffer.71 @param buffer The JS StringBufferto release.70 @abstract Releases a JavaScript string. 71 @param buffer The JSInternalString to release. 72 72 */ 73 void JS StringBufferRelease(JSStringBufferRef buffer);73 void JSInternalStringRelease(JSInternalStringRef buffer); 74 74 75 75 /*! 76 76 @function 77 @abstract Returns the number of Unicode characters in a JavaScript string buffer.78 @param buffer The JS StringBufferwhose 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. 79 79 @result The number of Unicode characters stored in buffer. 80 80 */ 81 size_t JS StringBufferGetLength(JSStringBufferRef buffer);81 size_t JSInternalStringGetLength(JSInternalStringRef buffer); 82 82 /*! 83 83 @function 84 84 @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 JS StringBufferwhose 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. 87 87 @result A pointer to the Unicode character buffer that serves as buffer's 88 88 backing store, which will be deallocated when buffer is deallocated. 89 89 */ 90 const JSChar* JS StringBufferGetCharactersPtr(JSStringBufferRef buffer);90 const JSChar* JSInternalStringGetCharactersPtr(JSInternalStringRef buffer); 91 91 /*! 92 92 @function 93 @abstract Copies a JavaScript string buffer's Unicode characters into an93 @abstract Copies a JavaScript string's Unicode characters into an 94 94 external character buffer. 95 @param inBuffer The source JS StringBuffer.95 @param inBuffer The source JSInternalString. 96 96 @param outBuffer The destination JSChar buffer into which to copy inBuffer's 97 97 characters. On return, outBuffer contains the requested Unicode characters. 98 98 @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. 100 100 */ 101 void JS StringBufferGetCharacters(JSStringBufferRef inBuffer, JSChar* outBuffer, size_t numChars);101 void JSInternalStringGetCharacters(JSInternalStringRef inBuffer, JSChar* outBuffer, size_t numChars); 102 102 103 103 /*! 104 104 @function 105 105 @abstract Returns the maximum number of bytes required to encode the 106 contents of a JavaScript string bufferas a null-terminated UTF8 string.107 @param buffer The JS StringBufferwhose maximum encoded length (in bytes) you106 contents of a JavaScript string as a null-terminated UTF8 string. 107 @param buffer The JSInternalString whose maximum encoded length (in bytes) you 108 108 want to know. 109 109 @result The maximum number of bytes required to encode buffer's contents 110 110 as a null-terminated UTF8 string. 111 111 */ 112 size_t JS StringBufferGetMaxLengthUTF8(JSStringBufferRef buffer);112 size_t JSInternalStringGetMaxLengthUTF8(JSInternalStringRef buffer); 113 113 /*! 114 114 @function 115 @abstract Converts a JavaScript string buffer's contents into a115 @abstract Converts a JavaScript string's contents into a 116 116 null-terminated UTF8 string, and copies the result into an external byte buffer. 117 @param inBuffer The source JS StringBuffer.117 @param inBuffer The source JSInternalString. 118 118 @param outBuffer The destination byte buffer into which to copy a UTF8 string 119 119 representation of inBuffer. The buffer must be at least bufferSize bytes in length. … … 123 123 @result The number of bytes written into outBuffer (including the null-terminator byte). 124 124 */ 125 size_t JS StringBufferGetCharactersUTF8(JSStringBufferRef inBuffer, char* outBuffer, size_t bufferSize);125 size_t JSInternalStringGetCharactersUTF8(JSInternalStringRef inBuffer, char* outBuffer, size_t bufferSize); 126 126 127 127 /*! 128 128 @function 129 @abstract Tests whether the characters in two JavaScript string buffers match.130 @param a The first JS StringBufferto test.131 @param b The second JS StringBufferto 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. 132 132 @result true if the characters in the two buffers match, otherwise false. 133 133 */ 134 bool JS StringBufferIsEqual(JSStringBufferRef a, JSStringBufferRef b);134 bool JSInternalStringIsEqual(JSInternalStringRef a, JSInternalStringRef b); 135 135 /*! 136 136 @function 137 @abstract Tests whether the characters in a JavaScript string buffermatch137 @abstract Tests whether the characters in a JavaScript string match 138 138 the characters in a null-terminated UTF8 string. 139 @param a The JS StringBufferto test.139 @param a The JSInternalString to test. 140 140 @param b The null-terminated UTF8 string to test. 141 141 @result true if the characters in the two buffers match, otherwise false. 142 142 */ 143 bool JS StringBufferIsEqualUTF8(JSStringBufferRef a, const char* b);143 bool JSInternalStringIsEqualUTF8(JSInternalStringRef a, const char* b); 144 144 145 145 #if defined(__APPLE__) … … 148 148 /*! 149 149 @function 150 @abstract Creates a JavaScript string bufferfrom a CFString.150 @abstract Creates a JavaScript string from a CFString. 151 151 @discussion This function is optimized to take advantage of cases when 152 152 CFStringGetCharactersPtr returns a valid pointer. 153 @param string The CFString to copy into the new JS StringBuffer.154 @result A JS StringBuffercontaining 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. 155 155 */ 156 JS StringBufferRef JSStringBufferCreateCF(CFStringRef string);156 JSInternalStringRef JSInternalStringCreateCF(CFStringRef string); 157 157 /*! 158 158 @function 159 @abstract Creates a CFString form a JavaScript string buffer.159 @abstract Creates a CFString form a JavaScript string. 160 160 @param alloc The alloc parameter to pass to CFStringCreate. 161 @param buffer The JS StringBufferto copy into the new CFString.161 @param buffer The JSInternalString to copy into the new CFString. 162 162 @result A CFString containing buffer. Ownership follows the create rule. 163 163 */ 164 CFStringRef CFStringCreateWithJS StringBuffer(CFAllocatorRef alloc, JSStringBufferRef buffer);164 CFStringRef CFStringCreateWithJSInternalString(CFAllocatorRef alloc, JSInternalStringRef buffer); 165 165 #endif // __APPLE__ 166 166 … … 169 169 #endif 170 170 171 #endif // JS StringBufferRef_h171 #endif // JSInternalStringRef_h
Note:
See TracChangeset
for help on using the changeset viewer.