Title: [124069] trunk/Source/WTF
Revision
124069
Author
par...@webkit.org
Date
2012-07-30 11:53:42 -0700 (Mon, 30 Jul 2012)

Log Message

Add special export macro for string related functions
https://bugs.webkit.org/show_bug.cgi?id=92624

Reviewed by Hajime Morita.

The windows port compiles string related code into every binary for performance reasons (see r59187).
Add the WTF_EXPORT_STRING_API define to allow this behaviour with export macros too.

* wtf/ExportMacros.h:
* wtf/text/AtomicString.h:
(AtomicString):
* wtf/text/StringImpl.h:
(StringImpl):
(WTF):
* wtf/text/WTFString.h:
(WTF):
(String):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (124068 => 124069)


--- trunk/Source/WTF/ChangeLog	2012-07-30 18:49:49 UTC (rev 124068)
+++ trunk/Source/WTF/ChangeLog	2012-07-30 18:53:42 UTC (rev 124069)
@@ -1,5 +1,25 @@
 2012-07-30  Patrick Gansterer  <par...@webkit.org>
 
+        Add special export macro for string related functions
+        https://bugs.webkit.org/show_bug.cgi?id=92624
+
+        Reviewed by Hajime Morita.
+
+        The windows port compiles string related code into every binary for performance reasons (see r59187).
+        Add the WTF_EXPORT_STRING_API define to allow this behaviour with export macros too.
+
+        * wtf/ExportMacros.h:
+        * wtf/text/AtomicString.h:
+        (AtomicString):
+        * wtf/text/StringImpl.h:
+        (StringImpl):
+        (WTF):
+        * wtf/text/WTFString.h:
+        (WTF):
+        (String):
+
+2012-07-30  Patrick Gansterer  <par...@webkit.org>
+
         Replace UnicodeWinCE with UnicodeWchar
         https://bugs.webkit.org/show_bug.cgi?id=92539
 

Modified: trunk/Source/WTF/wtf/ExportMacros.h (124068 => 124069)


--- trunk/Source/WTF/wtf/ExportMacros.h	2012-07-30 18:49:49 UTC (rev 124068)
+++ trunk/Source/WTF/wtf/ExportMacros.h	2012-07-30 18:53:42 UTC (rev 124069)
@@ -141,6 +141,12 @@
 #define WTF_EXPORT_PRIVATE_NO_RTTI WTF_EXPORT_PRIVATE
 #endif
 
+#if PLATFORM(WIN)
+#define WTF_EXPORT_STRING_API
+#else
+#define WTF_EXPORT_STRING_API WTF_EXPORT_PRIVATE
+#endif
+
 #define WTF_EXPORT_HIDDEN WTF_HIDDEN
 
 #define HIDDEN_INLINE WTF_EXPORT_HIDDEN inline

Modified: trunk/Source/WTF/wtf/text/AtomicString.h (124068 => 124069)


--- trunk/Source/WTF/wtf/text/AtomicString.h	2012-07-30 18:49:49 UTC (rev 124068)
+++ trunk/Source/WTF/wtf/text/AtomicString.h	2012-07-30 18:53:42 UTC (rev 124069)
@@ -79,7 +79,7 @@
     AtomicString(WTF::HashTableDeletedValueType) : m_string(WTF::HashTableDeletedValue) { }
     bool isHashTableDeletedValue() const { return m_string.isHashTableDeletedValue(); }
 
-    WTF_EXPORT_PRIVATE static AtomicStringImpl* find(const UChar* s, unsigned length, unsigned existingHash);
+    WTF_EXPORT_STRING_API static AtomicStringImpl* find(const UChar*, unsigned length, unsigned existingHash);
 
     operator const String&() const { return m_string; }
     const String& string() const { return m_string; };
@@ -119,7 +119,7 @@
     bool endsWith(const char (&prefix)[matchLength], bool caseSensitive = true) const
         { return m_string.endsWith<matchLength>(prefix, caseSensitive); }
     
-    WTF_EXPORT_PRIVATE AtomicString lower() const;
+    WTF_EXPORT_STRING_API AtomicString lower() const;
     AtomicString upper() const { return AtomicString(impl()->upper()); }
     
     int toInt(bool* ok = 0) const { return m_string.toInt(ok); }
@@ -156,22 +156,22 @@
 private:
     String m_string;
     
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> add(const LChar*);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> add(const LChar*);
     ALWAYS_INLINE static PassRefPtr<StringImpl> add(const char* s) { return add(reinterpret_cast<const LChar*>(s)); };
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> add(const UChar*, unsigned length);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> add(const UChar*, unsigned length);
     ALWAYS_INLINE static PassRefPtr<StringImpl> add(const char* s, unsigned length) { return add(reinterpret_cast<const char*>(s), length); };
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> add(const UChar*, unsigned length, unsigned existingHash);
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> add(const UChar*);
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> add(StringImpl*, unsigned offset, unsigned length);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> add(const UChar*, unsigned length, unsigned existingHash);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> add(const UChar*);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> add(StringImpl*, unsigned offset, unsigned length);
     ALWAYS_INLINE static PassRefPtr<StringImpl> add(StringImpl* r)
     {
         if (!r || r->isAtomic())
             return r;
         return addSlowCase(r);
     }
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> addFromLiteralData(const LChar *characters, unsigned length);
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> addSlowCase(StringImpl*);
-    WTF_EXPORT_PRIVATE static AtomicString fromUTF8Internal(const char*, const char*);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> addFromLiteralData(const LChar *characters, unsigned length);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> addSlowCase(StringImpl*);
+    WTF_EXPORT_STRING_API static AtomicString fromUTF8Internal(const char*, const char*);
 };
 
 inline bool operator==(const AtomicString& a, const AtomicString& b) { return a.impl() == b.impl(); }

Modified: trunk/Source/WTF/wtf/text/StringImpl.h (124068 => 124069)


--- trunk/Source/WTF/wtf/text/StringImpl.h	2012-07-30 18:49:49 UTC (rev 124068)
+++ trunk/Source/WTF/wtf/text/StringImpl.h	2012-07-30 18:53:42 UTC (rev 124069)
@@ -249,12 +249,12 @@
 #endif
 
 public:
-    WTF_EXPORT_PRIVATE ~StringImpl();
+    WTF_EXPORT_STRING_API ~StringImpl();
 
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> create(const UChar*, unsigned length);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> create(const UChar*, unsigned length);
     static PassRefPtr<StringImpl> create(const LChar*, unsigned length);
     ALWAYS_INLINE static PassRefPtr<StringImpl> create(const char* s, unsigned length) { return create(reinterpret_cast<const LChar*>(s), length); }
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> create(const LChar*);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> create(const LChar*);
     ALWAYS_INLINE static PassRefPtr<StringImpl> create(const char* s) { return create(reinterpret_cast<const LChar*>(s)); }
 
     static ALWAYS_INLINE PassRefPtr<StringImpl> create8(PassRefPtr<StringImpl> rep, unsigned offset, unsigned length)
@@ -284,7 +284,7 @@
         return adoptRef(new StringImpl(rep->m_data16 + offset, length, ownerRep));
     }
 
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> createFromLiteral(const LChar* characters, unsigned length);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> createFromLiteral(const LChar* characters, unsigned length);
     template<unsigned charactersCount>
     ALWAYS_INLINE static PassRefPtr<StringImpl> createFromLiteral(const char (&characters)[charactersCount])
     {
@@ -294,8 +294,8 @@
         return createFromLiteral(reinterpret_cast<const LChar*>(characters), charactersCount - 1);
     }
 
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> createUninitialized(unsigned length, LChar*& data);
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> createUninitialized(unsigned length, UChar*& data);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> createUninitialized(unsigned length, LChar*& data);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> createUninitialized(unsigned length, UChar*& data);
     template <typename T> static ALWAYS_INLINE PassRefPtr<StringImpl> tryCreateUninitialized(unsigned length, T*& output)
     {
         if (!length) {
@@ -348,8 +348,8 @@
         return empty();
     }
 
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> adopt(StringBuffer<UChar>&);
-    WTF_EXPORT_PRIVATE static PassRefPtr<StringImpl> adopt(StringBuffer<LChar>&);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> adopt(StringBuffer<UChar>&);
+    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> adopt(StringBuffer<LChar>&);
 
 #if PLATFORM(QT) && HAVE(QT5)
     static PassRefPtr<StringImpl> adopt(QStringData*);
@@ -388,7 +388,7 @@
     WTF_EXPORT_PRIVATE size_t sizeInBytes() const;
 
     bool has16BitShadow() const { return m_hashAndFlags & s_hashFlagHas16BitShadow; }
-    WTF_EXPORT_PRIVATE void upconvertCharacters(unsigned, unsigned) const;
+    WTF_EXPORT_STRING_API void upconvertCharacters(unsigned, unsigned) const;
     bool isIdentifier() const { return m_hashAndFlags & s_hashFlagIsIdentifier; }
     void setIsIdentifier(bool isIdentifier)
     {
@@ -517,7 +517,7 @@
     // its own copy of the string.
     PassRefPtr<StringImpl> isolatedCopy() const;
 
-    WTF_EXPORT_PRIVATE PassRefPtr<StringImpl> substring(unsigned pos, unsigned len = UINT_MAX);
+    WTF_EXPORT_STRING_API PassRefPtr<StringImpl> substring(unsigned pos, unsigned len = UINT_MAX);
 
     UChar operator[](unsigned i) const
     {
@@ -526,9 +526,9 @@
             return m_data8[i];
         return m_data16[i];
     }
-    WTF_EXPORT_PRIVATE UChar32 characterStartingAt(unsigned);
+    WTF_EXPORT_STRING_API UChar32 characterStartingAt(unsigned);
 
-    WTF_EXPORT_PRIVATE bool containsOnlyWhitespace();
+    WTF_EXPORT_STRING_API bool containsOnlyWhitespace();
 
     int toIntStrict(bool* ok = 0, int base = 10);
     unsigned toUIntStrict(bool* ok = 0, int base = 10);
@@ -536,7 +536,7 @@
     uint64_t toUInt64Strict(bool* ok = 0, int base = 10);
     intptr_t toIntPtrStrict(bool* ok = 0, int base = 10);
 
-    WTF_EXPORT_PRIVATE int toInt(bool* ok = 0); // ignores trailing garbage
+    WTF_EXPORT_STRING_API int toInt(bool* ok = 0); // ignores trailing garbage
     unsigned toUInt(bool* ok = 0); // ignores trailing garbage
     int64_t toInt64(bool* ok = 0); // ignores trailing garbage
     uint64_t toUInt64(bool* ok = 0); // ignores trailing garbage
@@ -548,16 +548,16 @@
     double toDouble(bool* ok = 0);
     float toFloat(bool* ok = 0);
 
-    WTF_EXPORT_PRIVATE PassRefPtr<StringImpl> lower();
-    WTF_EXPORT_PRIVATE PassRefPtr<StringImpl> upper();
+    WTF_EXPORT_STRING_API PassRefPtr<StringImpl> lower();
+    WTF_EXPORT_STRING_API PassRefPtr<StringImpl> upper();
 
-    WTF_EXPORT_PRIVATE PassRefPtr<StringImpl> fill(UChar);
+    WTF_EXPORT_STRING_API PassRefPtr<StringImpl> fill(UChar);
     // FIXME: Do we need fill(char) or can we just do the right thing if UChar is ASCII?
     PassRefPtr<StringImpl> foldCase();
 
     PassRefPtr<StringImpl> stripWhiteSpace();
     PassRefPtr<StringImpl> stripWhiteSpace(IsWhiteSpaceFunctionPtr);
-    WTF_EXPORT_PRIVATE PassRefPtr<StringImpl> simplifyWhiteSpace();
+    WTF_EXPORT_STRING_API PassRefPtr<StringImpl> simplifyWhiteSpace();
     PassRefPtr<StringImpl> simplifyWhiteSpace(IsWhiteSpaceFunctionPtr);
 
     PassRefPtr<StringImpl> removeCharacters(CharacterMatchFunctionPtr);
@@ -567,37 +567,37 @@
     size_t find(LChar character, unsigned start = 0);
     size_t find(char character, unsigned start = 0);
     size_t find(UChar character, unsigned start = 0);
-    WTF_EXPORT_PRIVATE size_t find(CharacterMatchFunctionPtr, unsigned index = 0);
+    WTF_EXPORT_STRING_API size_t find(CharacterMatchFunctionPtr, unsigned index = 0);
     size_t find(const LChar*, unsigned index = 0);
     ALWAYS_INLINE size_t find(const char* s, unsigned index = 0) { return find(reinterpret_cast<const LChar*>(s), index); };
-    WTF_EXPORT_PRIVATE size_t find(StringImpl*);
-    WTF_EXPORT_PRIVATE size_t find(StringImpl*, unsigned index);
+    WTF_EXPORT_STRING_API size_t find(StringImpl*);
+    WTF_EXPORT_STRING_API size_t find(StringImpl*, unsigned index);
     size_t findIgnoringCase(const LChar*, unsigned index = 0);
     ALWAYS_INLINE size_t findIgnoringCase(const char* s, unsigned index = 0) { return findIgnoringCase(reinterpret_cast<const LChar*>(s), index); };
-    WTF_EXPORT_PRIVATE size_t findIgnoringCase(StringImpl*, unsigned index = 0);
+    WTF_EXPORT_STRING_API size_t findIgnoringCase(StringImpl*, unsigned index = 0);
 
-    WTF_EXPORT_PRIVATE size_t reverseFind(UChar, unsigned index = UINT_MAX);
-    WTF_EXPORT_PRIVATE size_t reverseFind(StringImpl*, unsigned index = UINT_MAX);
-    WTF_EXPORT_PRIVATE size_t reverseFindIgnoringCase(StringImpl*, unsigned index = UINT_MAX);
+    WTF_EXPORT_STRING_API size_t reverseFind(UChar, unsigned index = UINT_MAX);
+    WTF_EXPORT_STRING_API size_t reverseFind(StringImpl*, unsigned index = UINT_MAX);
+    WTF_EXPORT_STRING_API size_t reverseFindIgnoringCase(StringImpl*, unsigned index = UINT_MAX);
 
     bool startsWith(StringImpl* str, bool caseSensitive = true) { return (caseSensitive ? reverseFind(str, 0) : reverseFindIgnoringCase(str, 0)) == 0; }
-    WTF_EXPORT_PRIVATE bool startsWith(UChar) const;
-    WTF_EXPORT_PRIVATE bool startsWith(const char*, unsigned matchLength, bool caseSensitive) const;
+    WTF_EXPORT_STRING_API bool startsWith(UChar) const;
+    WTF_EXPORT_STRING_API bool startsWith(const char*, unsigned matchLength, bool caseSensitive) const;
     template<unsigned matchLength>
     bool startsWith(const char (&prefix)[matchLength], bool caseSensitive = true) const { return startsWith(prefix, matchLength - 1, caseSensitive); };
 
-    WTF_EXPORT_PRIVATE bool endsWith(StringImpl*, bool caseSensitive = true);
-    WTF_EXPORT_PRIVATE bool endsWith(UChar) const;
-    WTF_EXPORT_PRIVATE bool endsWith(const char*, unsigned matchLength, bool caseSensitive) const;
+    WTF_EXPORT_STRING_API bool endsWith(StringImpl*, bool caseSensitive = true);
+    WTF_EXPORT_STRING_API bool endsWith(UChar) const;
+    WTF_EXPORT_STRING_API bool endsWith(const char*, unsigned matchLength, bool caseSensitive) const;
     template<unsigned matchLength>
     bool endsWith(const char (&prefix)[matchLength], bool caseSensitive = true) const { return endsWith(prefix, matchLength - 1, caseSensitive); }
 
-    WTF_EXPORT_PRIVATE PassRefPtr<StringImpl> replace(UChar, UChar);
-    WTF_EXPORT_PRIVATE PassRefPtr<StringImpl> replace(UChar, StringImpl*);
-    WTF_EXPORT_PRIVATE PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*);
-    WTF_EXPORT_PRIVATE PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*);
+    WTF_EXPORT_STRING_API PassRefPtr<StringImpl> replace(UChar, UChar);
+    WTF_EXPORT_STRING_API PassRefPtr<StringImpl> replace(UChar, StringImpl*);
+    WTF_EXPORT_STRING_API PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*);
+    WTF_EXPORT_STRING_API PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*);
 
-    WTF_EXPORT_PRIVATE WTF::Unicode::Direction defaultWritingDirection(bool* hasStrongDirectionality = 0);
+    WTF_EXPORT_STRING_API WTF::Unicode::Direction defaultWritingDirection(bool* hasStrongDirectionality = 0);
 
 #if USE(CF)
     CFStringRef createCFString();
@@ -614,7 +614,7 @@
     bool isStatic() const { return m_refCount & s_refCountFlagIsStaticString; }
     template <class UCharPredicate> PassRefPtr<StringImpl> stripMatchedCharacters(UCharPredicate);
     template <typename CharType, class UCharPredicate> PassRefPtr<StringImpl> simplifyMatchedCharactersToSpace(UCharPredicate);
-    WTF_EXPORT_PRIVATE NEVER_INLINE const UChar* getData16SlowCase() const;
+    WTF_EXPORT_STRING_API NEVER_INLINE const UChar* getData16SlowCase() const;
     WTF_EXPORT_PRIVATE NEVER_INLINE unsigned hashSlowCase() const;
 
     // The bottom bit in the ref count indicates a static (immortal) string.
@@ -657,14 +657,14 @@
 template <>
 ALWAYS_INLINE const UChar* StringImpl::getCharacters<UChar>() const { return characters(); }
 
-WTF_EXPORT_PRIVATE bool equal(const StringImpl*, const StringImpl*);
-WTF_EXPORT_PRIVATE bool equal(const StringImpl*, const LChar*);
+WTF_EXPORT_STRING_API bool equal(const StringImpl*, const StringImpl*);
+WTF_EXPORT_STRING_API bool equal(const StringImpl*, const LChar*);
 inline bool equal(const StringImpl* a, const char* b) { return equal(a, reinterpret_cast<const LChar*>(b)); }
-WTF_EXPORT_PRIVATE bool equal(const StringImpl*, const LChar*, unsigned);
+WTF_EXPORT_STRING_API bool equal(const StringImpl*, const LChar*, unsigned);
 inline bool equal(const StringImpl* a, const char* b, unsigned length) { return equal(a, reinterpret_cast<const LChar*>(b), length); }
 inline bool equal(const LChar* a, StringImpl* b) { return equal(b, a); }
 inline bool equal(const char* a, StringImpl* b) { return equal(b, reinterpret_cast<const LChar*>(a)); }
-WTF_EXPORT_PRIVATE bool equal(const StringImpl*, const UChar*, unsigned);
+WTF_EXPORT_STRING_API bool equal(const StringImpl*, const UChar*, unsigned);
 
 // Do comparisons 8 or 4 bytes-at-a-time on architectures where it's safe.
 #if CPU(X86_64)
@@ -822,16 +822,16 @@
     return true;
 }
 
-WTF_EXPORT_PRIVATE bool equalIgnoringCase(StringImpl*, StringImpl*);
-WTF_EXPORT_PRIVATE bool equalIgnoringCase(StringImpl*, const LChar*);
+WTF_EXPORT_STRING_API bool equalIgnoringCase(StringImpl*, StringImpl*);
+WTF_EXPORT_STRING_API bool equalIgnoringCase(StringImpl*, const LChar*);
 inline bool equalIgnoringCase(const LChar* a, StringImpl* b) { return equalIgnoringCase(b, a); }
-WTF_EXPORT_PRIVATE bool equalIgnoringCase(const LChar*, const LChar*, unsigned);
-WTF_EXPORT_PRIVATE bool equalIgnoringCase(const UChar*, const LChar*, unsigned);
+WTF_EXPORT_STRING_API bool equalIgnoringCase(const LChar*, const LChar*, unsigned);
+WTF_EXPORT_STRING_API bool equalIgnoringCase(const UChar*, const LChar*, unsigned);
 inline bool equalIgnoringCase(const UChar* a, const char* b, unsigned length) { return equalIgnoringCase(a, reinterpret_cast<const LChar*>(b), length); }
 inline bool equalIgnoringCase(const LChar* a, const UChar* b, unsigned length) { return equalIgnoringCase(b, a, length); }
 inline bool equalIgnoringCase(const char* a, const UChar* b, unsigned length) { return equalIgnoringCase(b, reinterpret_cast<const LChar*>(a), length); }
 
-WTF_EXPORT_PRIVATE bool equalIgnoringNullity(StringImpl*, StringImpl*);
+WTF_EXPORT_STRING_API bool equalIgnoringNullity(StringImpl*, StringImpl*);
 
 template<typename CharacterType>
 inline size_t find(const CharacterType* characters, unsigned length, CharacterType matchCharacter, unsigned index = 0)

Modified: trunk/Source/WTF/wtf/text/WTFString.h (124068 => 124069)


--- trunk/Source/WTF/wtf/text/WTFString.h	2012-07-30 18:49:49 UTC (rev 124068)
+++ trunk/Source/WTF/wtf/text/WTFString.h	2012-07-30 18:53:42 UTC (rev 124069)
@@ -63,9 +63,9 @@
 // Declarations of string operations
 
 int charactersToIntStrict(const LChar*, size_t, bool* ok = 0, int base = 10);
-WTF_EXPORT_PRIVATE int charactersToIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
+WTF_EXPORT_STRING_API int charactersToIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
 unsigned charactersToUIntStrict(const LChar*, size_t, bool* ok = 0, int base = 10);
-WTF_EXPORT_PRIVATE unsigned charactersToUIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
+WTF_EXPORT_STRING_API unsigned charactersToUIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
 int64_t charactersToInt64Strict(const LChar*, size_t, bool* ok = 0, int base = 10);
 int64_t charactersToInt64Strict(const UChar*, size_t, bool* ok = 0, int base = 10);
 uint64_t charactersToUInt64Strict(const LChar*, size_t, bool* ok = 0, int base = 10);
@@ -74,7 +74,7 @@
 intptr_t charactersToIntPtrStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
 
 int charactersToInt(const LChar*, size_t, bool* ok = 0); // ignores trailing garbage
-WTF_EXPORT_PRIVATE int charactersToInt(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
+WTF_EXPORT_STRING_API int charactersToInt(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
 unsigned charactersToUInt(const LChar*, size_t, bool* ok = 0); // ignores trailing garbage
 unsigned charactersToUInt(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
 int64_t charactersToInt64(const LChar*, size_t, bool* ok = 0); // ignores trailing garbage
@@ -87,12 +87,12 @@
 // FIXME: Like the strict functions above, these give false for "ok" when there is trailing garbage.
 // Like the non-strict functions above, these return the value when there is trailing garbage.
 // It would be better if these were more consistent with the above functions instead.
-WTF_EXPORT_PRIVATE double charactersToDouble(const LChar*, size_t, bool* ok = 0);
-WTF_EXPORT_PRIVATE double charactersToDouble(const UChar*, size_t, bool* ok = 0);
+WTF_EXPORT_STRING_API double charactersToDouble(const LChar*, size_t, bool* ok = 0);
+WTF_EXPORT_STRING_API double charactersToDouble(const UChar*, size_t, bool* ok = 0);
 float charactersToFloat(const LChar*, size_t, bool* ok = 0);
-WTF_EXPORT_PRIVATE float charactersToFloat(const UChar*, size_t, bool* ok = 0);
-WTF_EXPORT_PRIVATE float charactersToFloat(const LChar*, size_t, size_t& parsedLength);
-WTF_EXPORT_PRIVATE float charactersToFloat(const UChar*, size_t, size_t& parsedLength);
+WTF_EXPORT_STRING_API float charactersToFloat(const UChar*, size_t, bool* ok = 0);
+WTF_EXPORT_STRING_API float charactersToFloat(const LChar*, size_t, size_t& parsedLength);
+WTF_EXPORT_STRING_API float charactersToFloat(const UChar*, size_t, size_t& parsedLength);
 
 enum FloatConversionFlags {
     ShouldRoundSignificantFigures = 1 << 0,
@@ -108,7 +108,7 @@
     String() { }
 
     // Construct a string with UTF-16 data.
-    WTF_EXPORT_PRIVATE String(const UChar* characters, unsigned length);
+    WTF_EXPORT_STRING_API String(const UChar* characters, unsigned length);
 
     // Construct a string by copying the contents of a vector.  To avoid
     // copying, consider using String::adopt instead.
@@ -116,15 +116,15 @@
     explicit String(const Vector<UChar, inlineCapacity>&);
 
     // Construct a string with UTF-16 data, from a null-terminated source.
-    WTF_EXPORT_PRIVATE String(const UChar*);
+    WTF_EXPORT_STRING_API String(const UChar*);
 
     // Construct a string with latin1 data.
-    WTF_EXPORT_PRIVATE String(const LChar* characters, unsigned length);
-    WTF_EXPORT_PRIVATE String(const char* characters, unsigned length);
+    WTF_EXPORT_STRING_API String(const LChar* characters, unsigned length);
+    WTF_EXPORT_STRING_API String(const char* characters, unsigned length);
 
     // Construct a string with latin1 data, from a null-terminated source.
-    WTF_EXPORT_PRIVATE String(const LChar* characters);
-    WTF_EXPORT_PRIVATE String(const char* characters);
+    WTF_EXPORT_STRING_API String(const LChar* characters);
+    WTF_EXPORT_STRING_API String(const char* characters);
 
     // Construct a string referencing an existing StringImpl.
     String(StringImpl* impl) : m_impl(impl) { }
@@ -190,9 +190,9 @@
 
     bool is8Bit() const { return m_impl->is8Bit(); }
 
-    WTF_EXPORT_PRIVATE CString ascii() const;
-    WTF_EXPORT_PRIVATE CString latin1() const;
-    WTF_EXPORT_PRIVATE CString utf8(bool strict = false) const;
+    WTF_EXPORT_STRING_API CString ascii() const;
+    WTF_EXPORT_STRING_API CString latin1() const;
+    WTF_EXPORT_STRING_API CString utf8(bool strict = false) const;
 
     UChar operator[](unsigned index) const
     {
@@ -202,14 +202,14 @@
     }
 
     static String number(short);
-    WTF_EXPORT_PRIVATE static String number(unsigned short);
-    WTF_EXPORT_PRIVATE static String number(int);
-    WTF_EXPORT_PRIVATE static String number(unsigned);
-    WTF_EXPORT_PRIVATE static String number(long);
-    WTF_EXPORT_PRIVATE static String number(unsigned long);
-    WTF_EXPORT_PRIVATE static String number(long long);
-    WTF_EXPORT_PRIVATE static String number(unsigned long long);
-    WTF_EXPORT_PRIVATE static String number(double, unsigned = ShouldRoundSignificantFigures | ShouldTruncateTrailingZeros, unsigned precision = 6);
+    WTF_EXPORT_STRING_API static String number(unsigned short);
+    WTF_EXPORT_STRING_API static String number(int);
+    WTF_EXPORT_STRING_API static String number(unsigned);
+    WTF_EXPORT_STRING_API static String number(long);
+    WTF_EXPORT_STRING_API static String number(unsigned long);
+    WTF_EXPORT_STRING_API static String number(long long);
+    WTF_EXPORT_STRING_API static String number(unsigned long long);
+    WTF_EXPORT_STRING_API static String number(double, unsigned = ShouldRoundSignificantFigures | ShouldTruncateTrailingZeros, unsigned precision = 6);
 
     // Find a single character or string, also with match function & latin1 forms.
     size_t find(UChar c, unsigned start = 0) const
@@ -247,9 +247,9 @@
     size_t reverseFind(const String& str, unsigned start, bool caseSensitive) const
         { return caseSensitive ? reverseFind(str, start) : reverseFindIgnoringCase(str, start); }
 
-    WTF_EXPORT_PRIVATE const UChar* charactersWithNullTermination();
+    WTF_EXPORT_STRING_API const UChar* charactersWithNullTermination();
     
-    WTF_EXPORT_PRIVATE UChar32 characterStartingAt(unsigned) const; // Ditto.
+    WTF_EXPORT_STRING_API UChar32 characterStartingAt(unsigned) const; // Ditto.
     
     bool contains(UChar c) const { return find(c) != notFound; }
     bool contains(const LChar* str, bool caseSensitive = true) const { return find(str, 0, caseSensitive) != notFound; }
@@ -271,12 +271,12 @@
     bool endsWith(const char (&prefix)[matchLength], bool caseSensitive = true) const
         { return m_impl ? m_impl->endsWith<matchLength>(prefix, caseSensitive) : !matchLength; }
 
-    WTF_EXPORT_PRIVATE void append(const String&);
-    WTF_EXPORT_PRIVATE void append(LChar);
+    WTF_EXPORT_STRING_API void append(const String&);
+    WTF_EXPORT_STRING_API void append(LChar);
     void append(char c) { append(static_cast<LChar>(c)); };
-    WTF_EXPORT_PRIVATE void append(UChar);
-    WTF_EXPORT_PRIVATE void append(const UChar*, unsigned length);
-    WTF_EXPORT_PRIVATE void insert(const String&, unsigned pos);
+    WTF_EXPORT_STRING_API void append(UChar);
+    WTF_EXPORT_STRING_API void append(const UChar*, unsigned length);
+    WTF_EXPORT_STRING_API void insert(const String&, unsigned pos);
     void insert(const UChar*, unsigned length, unsigned pos);
 
     String& replace(UChar a, UChar b) { if (m_impl) m_impl = m_impl->replace(a, b); return *this; }
@@ -288,33 +288,33 @@
     void makeUpper() { if (m_impl) m_impl = m_impl->upper(); }
     void fill(UChar c) { if (m_impl) m_impl = m_impl->fill(c); }
 
-    WTF_EXPORT_PRIVATE void truncate(unsigned len);
-    WTF_EXPORT_PRIVATE void remove(unsigned pos, int len = 1);
+    WTF_EXPORT_STRING_API void truncate(unsigned len);
+    WTF_EXPORT_STRING_API void remove(unsigned pos, int len = 1);
 
-    WTF_EXPORT_PRIVATE String substring(unsigned pos, unsigned len = UINT_MAX) const;
+    WTF_EXPORT_STRING_API String substring(unsigned pos, unsigned len = UINT_MAX) const;
     String substringSharingImpl(unsigned pos, unsigned len = UINT_MAX) const;
     String left(unsigned len) const { return substring(0, len); }
     String right(unsigned len) const { return substring(length() - len, len); }
 
     // Returns a lowercase/uppercase version of the string
-    WTF_EXPORT_PRIVATE String lower() const;
-    WTF_EXPORT_PRIVATE String upper() const;
+    WTF_EXPORT_STRING_API String lower() const;
+    WTF_EXPORT_STRING_API String upper() const;
 
-    WTF_EXPORT_PRIVATE String stripWhiteSpace() const;
-    WTF_EXPORT_PRIVATE String stripWhiteSpace(IsWhiteSpaceFunctionPtr) const;
-    WTF_EXPORT_PRIVATE String simplifyWhiteSpace() const;
-    WTF_EXPORT_PRIVATE String simplifyWhiteSpace(IsWhiteSpaceFunctionPtr) const;
+    WTF_EXPORT_STRING_API String stripWhiteSpace() const;
+    WTF_EXPORT_STRING_API String stripWhiteSpace(IsWhiteSpaceFunctionPtr) const;
+    WTF_EXPORT_STRING_API String simplifyWhiteSpace() const;
+    WTF_EXPORT_STRING_API String simplifyWhiteSpace(IsWhiteSpaceFunctionPtr) const;
 
-    WTF_EXPORT_PRIVATE String removeCharacters(CharacterMatchFunctionPtr) const;
+    WTF_EXPORT_STRING_API String removeCharacters(CharacterMatchFunctionPtr) const;
     template<bool isSpecialCharacter(UChar)> bool isAllSpecialCharacters() const;
 
     // Return the string with case folded for case insensitive comparison.
-    WTF_EXPORT_PRIVATE String foldCase() const;
+    WTF_EXPORT_STRING_API String foldCase() const;
 
 #if !PLATFORM(QT)
-    WTF_EXPORT_PRIVATE static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
+    WTF_EXPORT_STRING_API static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
 #else
-    WTF_EXPORT_PRIVATE static String format(const char *, ...);
+    WTF_EXPORT_STRING_API static String format(const char *, ...);
 #endif
 
     // Returns an uninitialized string. The characters needs to be written
@@ -323,32 +323,32 @@
     static String createUninitialized(unsigned length, UChar*& data) { return StringImpl::createUninitialized(length, data); }
     static String createUninitialized(unsigned length, LChar*& data) { return StringImpl::createUninitialized(length, data); }
 
-    WTF_EXPORT_PRIVATE void split(const String& separator, Vector<String>& result) const;
-    WTF_EXPORT_PRIVATE void split(const String& separator, bool allowEmptyEntries, Vector<String>& result) const;
-    WTF_EXPORT_PRIVATE void split(UChar separator, Vector<String>& result) const;
-    WTF_EXPORT_PRIVATE void split(UChar separator, bool allowEmptyEntries, Vector<String>& result) const;
+    WTF_EXPORT_STRING_API void split(const String& separator, Vector<String>& result) const;
+    WTF_EXPORT_STRING_API void split(const String& separator, bool allowEmptyEntries, Vector<String>& result) const;
+    WTF_EXPORT_STRING_API void split(UChar separator, Vector<String>& result) const;
+    WTF_EXPORT_STRING_API void split(UChar separator, bool allowEmptyEntries, Vector<String>& result) const;
 
-    WTF_EXPORT_PRIVATE int toIntStrict(bool* ok = 0, int base = 10) const;
-    WTF_EXPORT_PRIVATE unsigned toUIntStrict(bool* ok = 0, int base = 10) const;
-    WTF_EXPORT_PRIVATE int64_t toInt64Strict(bool* ok = 0, int base = 10) const;
+    WTF_EXPORT_STRING_API int toIntStrict(bool* ok = 0, int base = 10) const;
+    WTF_EXPORT_STRING_API unsigned toUIntStrict(bool* ok = 0, int base = 10) const;
+    WTF_EXPORT_STRING_API int64_t toInt64Strict(bool* ok = 0, int base = 10) const;
     uint64_t toUInt64Strict(bool* ok = 0, int base = 10) const;
     intptr_t toIntPtrStrict(bool* ok = 0, int base = 10) const;
 
-    WTF_EXPORT_PRIVATE int toInt(bool* ok = 0) const;
-    WTF_EXPORT_PRIVATE unsigned toUInt(bool* ok = 0) const;
+    WTF_EXPORT_STRING_API int toInt(bool* ok = 0) const;
+    WTF_EXPORT_STRING_API unsigned toUInt(bool* ok = 0) const;
     int64_t toInt64(bool* ok = 0) const;
-    WTF_EXPORT_PRIVATE uint64_t toUInt64(bool* ok = 0) const;
-    WTF_EXPORT_PRIVATE intptr_t toIntPtr(bool* ok = 0) const;
+    WTF_EXPORT_STRING_API uint64_t toUInt64(bool* ok = 0) const;
+    WTF_EXPORT_STRING_API intptr_t toIntPtr(bool* ok = 0) const;
 
     // FIXME: Like the strict functions above, these give false for "ok" when there is trailing garbage.
     // Like the non-strict functions above, these return the value when there is trailing garbage.
     // It would be better if these were more consistent with the above functions instead.
-    WTF_EXPORT_PRIVATE double toDouble(bool* ok = 0) const;
-    WTF_EXPORT_PRIVATE float toFloat(bool* ok = 0) const;
+    WTF_EXPORT_STRING_API double toDouble(bool* ok = 0) const;
+    WTF_EXPORT_STRING_API float toFloat(bool* ok = 0) const;
 
     bool percentage(int& percentage) const;
 
-    WTF_EXPORT_PRIVATE String isolatedCopy() const;
+    WTF_EXPORT_STRING_API String isolatedCopy() const;
 
     // Prevent Strings from being implicitly convertable to bool as it will be ambiguous on any platform that
     // allows implicit conversion to another pointer type (e.g., Mac allows implicit conversion to NSString*).
@@ -388,13 +388,13 @@
 
     // String::fromUTF8 will return a null string if
     // the input data contains invalid UTF-8 sequences.
-    WTF_EXPORT_PRIVATE static String fromUTF8(const LChar*, size_t);
-    WTF_EXPORT_PRIVATE static String fromUTF8(const LChar*);
+    WTF_EXPORT_STRING_API static String fromUTF8(const LChar*, size_t);
+    WTF_EXPORT_STRING_API static String fromUTF8(const LChar*);
     static String fromUTF8(const char* s, size_t length) { return fromUTF8(reinterpret_cast<const LChar*>(s), length); };
     static String fromUTF8(const char* s) { return fromUTF8(reinterpret_cast<const LChar*>(s)); };
 
     // Tries to convert the passed in string to UTF-8, but will fall back to Latin-1 if the string is not valid UTF-8.
-    WTF_EXPORT_PRIVATE static String fromUTF8WithLatin1Fallback(const LChar*, size_t);
+    WTF_EXPORT_STRING_API static String fromUTF8WithLatin1Fallback(const LChar*, size_t);
     static String fromUTF8WithLatin1Fallback(const char* s, size_t length) { return fromUTF8WithLatin1Fallback(reinterpret_cast<const LChar*>(s), length); };
     
     // Determines the writing direction using the Unicode Bidi Algorithm rules P2 and P3.
@@ -416,7 +416,7 @@
     bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue(); }
 
 #ifndef NDEBUG
-    WTF_EXPORT_PRIVATE void show() const;
+    WTF_EXPORT_STRING_API void show() const;
 #endif
 
 private:
@@ -527,7 +527,7 @@
     return charactersAreAllASCII(characters16(), m_impl->length());
 }
 
-WTF_EXPORT_PRIVATE int codePointCompare(const String&, const String&);
+WTF_EXPORT_STRING_API int codePointCompare(const String&, const String&);
 
 inline bool codePointCompareLessThan(const String& a, const String& b)
 {
@@ -582,7 +582,7 @@
 template <> struct VectorTraits<String> : SimpleClassVectorTraits { };
 
 // Shared global empty string.
-WTF_EXPORT_PRIVATE const String& emptyString();
+WTF_EXPORT_STRING_API const String& emptyString();
 
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to