Changeset 87269 in webkit


Ignore:
Timestamp:
May 24, 2011 9:38:26 PM (13 years ago)
Author:
kevino@webkit.org
Message:

Reviewed by Eric Seidel.

Add export macros to WTFString.h.

https://bugs.webkit.org/show_bug.cgi?id=27551

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r87243 r87269  
     12011-05-24  Kevin Ollivier  <kevino@theolliviers.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Add export macros to WTFString.h.
     6       
     7        https://bugs.webkit.org/show_bug.cgi?id=27551
     8
     9        * wtf/text/WTFString.h:
     10        (WTF::String::String):
     11        (WTF::String::findIgnoringCase):
     12        (WTF::String::isHashTableDeletedValue):
     13
    1142011-05-24  Geoffrey Garen  <ggaren@apple.com>
    215
  • trunk/Source/JavaScriptCore/wtf/text/WTFString.h

    r86330 r87269  
    6868bool charactersAreAllASCII(const UChar*, size_t);
    6969bool charactersAreAllLatin1(const UChar*, size_t);
    70 int charactersToIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
    71 unsigned charactersToUIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
     70WTF_EXPORT_PRIVATE int charactersToIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
     71WTF_EXPORT_PRIVATE unsigned charactersToUIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
    7272int64_t charactersToInt64Strict(const UChar*, size_t, bool* ok = 0, int base = 10);
    7373uint64_t charactersToUInt64Strict(const UChar*, size_t, bool* ok = 0, int base = 10);
     
    8080intptr_t charactersToIntPtr(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
    8181
    82 double charactersToDouble(const UChar*, size_t, bool* ok = 0, bool* didReadNumber = 0);
     82WTF_EXPORT_PRIVATE double charactersToDouble(const UChar*, size_t, bool* ok = 0, bool* didReadNumber = 0);
    8383float charactersToFloat(const UChar*, size_t, bool* ok = 0, bool* didReadNumber = 0);
    8484
     
    8888public:
    8989    // Construct a null string, distinguishable from an empty string.
    90     String() { }
     90    WTF_EXPORT_PRIVATE String() { }
    9191
    9292    // Construct a string with UTF-16 data.
    93     String(const UChar* characters, unsigned length);
     93    WTF_EXPORT_PRIVATE String(const UChar* characters, unsigned length);
    9494
    9595    // Construct a string by copying the contents of a vector.  To avoid
     
    9999
    100100    // Construct a string with UTF-16 data, from a null-terminated source.
    101     String(const UChar*);
     101    WTF_EXPORT_PRIVATE String(const UChar*);
    102102
    103103    // Construct a string with latin1 data.
    104     String(const char* characters, unsigned length);
     104    WTF_EXPORT_PRIVATE String(const char* characters, unsigned length);
    105105
    106106    // Construct a string with latin1 data, from a null-terminated source.
    107     String(const char* characters);
     107    WTF_EXPORT_PRIVATE String(const char* characters);
    108108
    109109    // Construct a string referencing an existing StringImpl.
    110     String(StringImpl* impl) : m_impl(impl) { }
    111     String(PassRefPtr<StringImpl> impl) : m_impl(impl) { }
    112     String(RefPtr<StringImpl> impl) : m_impl(impl) { }
     110    WTF_EXPORT_PRIVATE String(StringImpl* impl) : m_impl(impl) { }
     111    WTF_EXPORT_PRIVATE String(PassRefPtr<StringImpl> impl) : m_impl(impl) { }
     112    WTF_EXPORT_PRIVATE String(RefPtr<StringImpl> impl) : m_impl(impl) { }
    113113
    114114    // Inline the destructor.
     
    140140    }
    141141
    142     CString ascii() const;
    143     CString latin1() const;
    144     CString utf8(bool strict = false) const;
     142    WTF_EXPORT_PRIVATE CString ascii() const;
     143    WTF_EXPORT_PRIVATE CString latin1() const;
     144    WTF_EXPORT_PRIVATE CString utf8(bool strict = false) const;
    145145
    146146    UChar operator[](unsigned index) const
     
    151151    }
    152152
    153     static String number(short);
    154     static String number(unsigned short);
    155     static String number(int);
    156     static String number(unsigned);
    157     static String number(long);
    158     static String number(unsigned long);
    159     static String number(long long);
    160     static String number(unsigned long long);
    161     static String number(double);
     153    WTF_EXPORT_PRIVATE static String number(short);
     154    WTF_EXPORT_PRIVATE static String number(unsigned short);
     155    WTF_EXPORT_PRIVATE static String number(int);
     156    WTF_EXPORT_PRIVATE static String number(unsigned);
     157    WTF_EXPORT_PRIVATE static String number(long);
     158    WTF_EXPORT_PRIVATE static String number(unsigned long);
     159    WTF_EXPORT_PRIVATE static String number(long long);
     160    WTF_EXPORT_PRIVATE static String number(unsigned long long);
     161    WTF_EXPORT_PRIVATE static String number(double);
    162162
    163163    // Find a single character or string, also with match function & latin1 forms.
     
    178178
    179179    // Case insensitive string matching.
    180     size_t findIgnoringCase(const char* str, unsigned start = 0) const
     180    WTF_EXPORT_PRIVATE size_t findIgnoringCase(const char* str, unsigned start = 0) const
    181181        { return m_impl ? m_impl->findIgnoringCase(str, start) : notFound; }
    182     size_t findIgnoringCase(const String& str, unsigned start = 0) const
     182    WTF_EXPORT_PRIVATE size_t findIgnoringCase(const String& str, unsigned start = 0) const
    183183        { return m_impl ? m_impl->findIgnoringCase(str.impl(), start) : notFound; }
    184184    size_t reverseFindIgnoringCase(const String& str, unsigned start = UINT_MAX) const
     
    193193        { return caseSensitive ? reverseFind(str, start) : reverseFindIgnoringCase(str, start); }
    194194
    195     const UChar* charactersWithNullTermination();
     195    WTF_EXPORT_PRIVATE const UChar* charactersWithNullTermination();
    196196   
    197     UChar32 characterStartingAt(unsigned) const; // Ditto.
     197    WTF_EXPORT_PRIVATE UChar32 characterStartingAt(unsigned) const; // Ditto.
    198198   
    199199    bool contains(UChar c) const { return find(c) != notFound; }
     
    206206        { return m_impl ? m_impl->endsWith(s.impl(), caseSensitive) : s.isEmpty(); }
    207207
    208     void append(const String&);
    209     void append(char);
    210     void append(UChar);
    211     void append(const UChar*, unsigned length);
    212     void insert(const String&, unsigned pos);
     208    WTF_EXPORT_PRIVATE void append(const String&);
     209    WTF_EXPORT_PRIVATE void append(char);
     210    WTF_EXPORT_PRIVATE void append(UChar);
     211    WTF_EXPORT_PRIVATE void append(const UChar*, unsigned length);
     212    WTF_EXPORT_PRIVATE void insert(const String&, unsigned pos);
    213213    void insert(const UChar*, unsigned length, unsigned pos);
    214214
     
    222222    void makeSecure(UChar aChar) { if (m_impl) m_impl = m_impl->secure(aChar); }
    223223
    224     void truncate(unsigned len);
    225     void remove(unsigned pos, int len = 1);
    226 
    227     String substring(unsigned pos, unsigned len = UINT_MAX) const;
     224    WTF_EXPORT_PRIVATE void truncate(unsigned len);
     225    WTF_EXPORT_PRIVATE void remove(unsigned pos, int len = 1);
     226
     227    WTF_EXPORT_PRIVATE String substring(unsigned pos, unsigned len = UINT_MAX) const;
    228228    String substringSharingImpl(unsigned pos, unsigned len = UINT_MAX) const;
    229229    String left(unsigned len) const { return substring(0, len); }
     
    231231
    232232    // Returns a lowercase/uppercase version of the string
    233     String lower() const;
    234     String upper() const;
    235 
    236     String stripWhiteSpace() const;
    237     String simplifyWhiteSpace() const;
    238 
    239     String removeCharacters(CharacterMatchFunctionPtr) const;
     233    WTF_EXPORT_PRIVATE String lower() const;
     234    WTF_EXPORT_PRIVATE String upper() const;
     235
     236    WTF_EXPORT_PRIVATE String stripWhiteSpace() const;
     237    WTF_EXPORT_PRIVATE String simplifyWhiteSpace() const;
     238
     239    WTF_EXPORT_PRIVATE String removeCharacters(CharacterMatchFunctionPtr) const;
    240240    template<bool isSpecialCharacter(UChar)> bool isAllSpecialCharacters() const;
    241241
    242242    // Return the string with case folded for case insensitive comparison.
    243     String foldCase() const;
     243    WTF_EXPORT_PRIVATE String foldCase() const;
    244244
    245245#if !PLATFORM(QT)
    246     static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
     246    WTF_EXPORT_PRIVATE static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
    247247#else
    248     static String format(const char *, ...);
     248    WTF_EXPORT_PRIVATE static String format(const char *, ...);
    249249#endif
    250250
     
    254254    static String createUninitialized(unsigned length, UChar*& data) { return StringImpl::createUninitialized(length, data); }
    255255
    256     void split(const String& separator, Vector<String>& result) const;
    257     void split(const String& separator, bool allowEmptyEntries, Vector<String>& result) const;
    258     void split(UChar separator, Vector<String>& result) const;
    259     void split(UChar separator, bool allowEmptyEntries, Vector<String>& result) const;
    260 
    261     int toIntStrict(bool* ok = 0, int base = 10) const;
    262     unsigned toUIntStrict(bool* ok = 0, int base = 10) const;
    263     int64_t toInt64Strict(bool* ok = 0, int base = 10) const;
    264     uint64_t toUInt64Strict(bool* ok = 0, int base = 10) const;
    265     intptr_t toIntPtrStrict(bool* ok = 0, int base = 10) const;
    266 
    267     int toInt(bool* ok = 0) const;
    268     unsigned toUInt(bool* ok = 0) const;
     256    WTF_EXPORT_PRIVATE void split(const String& separator, Vector<String>& result) const;
     257    WTF_EXPORT_PRIVATE void split(const String& separator, bool allowEmptyEntries, Vector<String>& result) const;
     258    WTF_EXPORT_PRIVATE void split(UChar separator, Vector<String>& result) const;
     259    WTF_EXPORT_PRIVATE void split(UChar separator, bool allowEmptyEntries, Vector<String>& result) const;
     260
     261    WTF_EXPORT_PRIVATE int toIntStrict(bool* ok = 0, int base = 10) const;
     262    WTF_EXPORT_PRIVATE unsigned toUIntStrict(bool* ok = 0, int base = 10) const;
     263    WTF_EXPORT_PRIVATE int64_t toInt64Strict(bool* ok = 0, int base = 10) const;
     264    WTF_EXPORT_PRIVATE uint64_t toUInt64Strict(bool* ok = 0, int base = 10) const;
     265    WTF_EXPORT_PRIVATE intptr_t toIntPtrStrict(bool* ok = 0, int base = 10) const;
     266
     267    WTF_EXPORT_PRIVATE int toInt(bool* ok = 0) const;
     268    WTF_EXPORT_PRIVATE unsigned toUInt(bool* ok = 0) const;
    269269    int64_t toInt64(bool* ok = 0) const;
    270     uint64_t toUInt64(bool* ok = 0) const;
    271     intptr_t toIntPtr(bool* ok = 0) const;
    272     double toDouble(bool* ok = 0, bool* didReadNumber = 0) const;
    273     float toFloat(bool* ok = 0, bool* didReadNumber = 0) const;
     270    WTF_EXPORT_PRIVATE uint64_t toUInt64(bool* ok = 0) const;
     271    WTF_EXPORT_PRIVATE intptr_t toIntPtr(bool* ok = 0) const;
     272    WTF_EXPORT_PRIVATE double toDouble(bool* ok = 0, bool* didReadNumber = 0) const;
     273    WTF_EXPORT_PRIVATE float toFloat(bool* ok = 0, bool* didReadNumber = 0) const;
    274274
    275275    bool percentage(int& percentage) const;
    276276
    277277    // Returns a StringImpl suitable for use on another thread.
    278     String crossThreadString() const;
     278    WTF_EXPORT_PRIVATE String crossThreadString() const;
    279279    // Makes a deep copy. Helpful only if you need to use a String on another thread
    280280    // (use crossThreadString if the method call doesn't need to be threadsafe).
    281281    // Since the underlying StringImpl objects are immutable, there's no other reason
    282282    // to ever prefer copy() over plain old assignment.
    283     String threadsafeCopy() const;
     283    WTF_EXPORT_PRIVATE String threadsafeCopy() const;
    284284
    285285    // Prevent Strings from being implicitly convertable to bool as it will be ambiguous on any platform that
     
    310310
    311311#if PLATFORM(WX)
    312     String(const wxString&);
    313     operator wxString() const;
     312    WTF_EXPORT_PRIVATE String(const wxString&);
     313    WTF_EXPORT_PRIVATE operator wxString() const;
    314314#endif
    315315
     
    325325    // String::fromUTF8 will return a null string if
    326326    // the input data contains invalid UTF-8 sequences.
    327     static String fromUTF8(const char*, size_t);
    328     static String fromUTF8(const char*);
     327    WTF_EXPORT_PRIVATE static String fromUTF8(const char*, size_t);
     328    WTF_EXPORT_PRIVATE static String fromUTF8(const char*);
    329329
    330330    // 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.
    331     static String fromUTF8WithLatin1Fallback(const char*, size_t);
     331    WTF_EXPORT_PRIVATE static String fromUTF8WithLatin1Fallback(const char*, size_t);
    332332   
    333333    // Determines the writing direction using the Unicode Bidi Algorithm rules P2 and P3.
     
    346346    // Hash table deleted values, which are only constructed and never copied or destroyed.
    347347    String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { }
    348     bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue(); }
     348    WTF_EXPORT_PRIVATE bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue(); }
    349349
    350350private:
     
    416416}
    417417
    418 int codePointCompare(const String&, const String&);
     418WTF_EXPORT_PRIVATE int codePointCompare(const String&, const String&);
    419419
    420420inline size_t find(const UChar* characters, unsigned length, UChar matchCharacter, unsigned index = 0)
     
    499499
    500500// Shared global empty string.
    501 const String& emptyString();
     501WTF_EXPORT_PRIVATE const String& emptyString();
    502502
    503503}
Note: See TracChangeset for help on using the changeset viewer.