| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights
reserved. | 3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights
reserved. |
| 4 * Copyright (C) 2009 Google Inc. All rights reserved. | 4 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #include <limits.h> | 26 #include <limits.h> |
| 27 #include "wtf/ASCIICType.h" | 27 #include "wtf/ASCIICType.h" |
| 28 #include "wtf/Forward.h" | 28 #include "wtf/Forward.h" |
| 29 #include "wtf/HashMap.h" | 29 #include "wtf/HashMap.h" |
| 30 #include "wtf/StringHasher.h" | 30 #include "wtf/StringHasher.h" |
| 31 #include "wtf/Vector.h" | 31 #include "wtf/Vector.h" |
| 32 #include "wtf/WTFExport.h" | 32 #include "wtf/WTFExport.h" |
| 33 #include "wtf/unicode/Unicode.h" | 33 #include "wtf/unicode/Unicode.h" |
| 34 | 34 |
| 35 #if USE(CF) |
| 36 typedef const struct __CFString * CFStringRef; |
| 37 #endif |
| 38 |
| 39 #ifdef __OBJC__ |
| 40 @class NSString; |
| 41 #endif |
| 42 |
| 35 namespace WTF { | 43 namespace WTF { |
| 36 | 44 |
| 37 struct AlreadyHashed; | 45 struct AlreadyHashed; |
| 38 struct CStringTranslator; | 46 struct CStringTranslator; |
| 39 template<typename CharacterType> struct HashAndCharactersTranslator; | 47 template<typename CharacterType> struct HashAndCharactersTranslator; |
| 40 struct HashAndUTF8CharactersTranslator; | 48 struct HashAndUTF8CharactersTranslator; |
| 41 struct LCharBufferTranslator; | 49 struct LCharBufferTranslator; |
| 42 struct CharBufferFromLiteralDataTranslator; | 50 struct CharBufferFromLiteralDataTranslator; |
| 43 struct SubstringTranslator; | 51 struct SubstringTranslator; |
| 44 struct UCharBufferTranslator; | 52 struct UCharBufferTranslator; |
| 53 template<typename> class RetainPtr; |
| 45 | 54 |
| 46 enum TextCaseSensitivity { TextCaseSensitive, TextCaseInsensitive }; | 55 enum TextCaseSensitivity { TextCaseSensitive, TextCaseInsensitive }; |
| 47 | 56 |
| 48 enum StripBehavior { StripExtraWhiteSpace, DoNotStripWhiteSpace }; | 57 enum StripBehavior { StripExtraWhiteSpace, DoNotStripWhiteSpace }; |
| 49 | 58 |
| 50 typedef bool (*CharacterMatchFunctionPtr)(UChar); | 59 typedef bool (*CharacterMatchFunctionPtr)(UChar); |
| 51 typedef bool (*IsWhiteSpaceFunctionPtr)(UChar); | 60 typedef bool (*IsWhiteSpaceFunctionPtr)(UChar); |
| 52 typedef HashMap<unsigned, StringImpl*, AlreadyHashed> StaticStringsTable; | 61 typedef HashMap<unsigned, StringImpl*, AlreadyHashed> StaticStringsTable; |
| 53 | 62 |
| 54 // Define STRING_STATS to turn on run time statistics of string sizes and memory
usage | 63 // Define STRING_STATS to turn on run time statistics of string sizes and memory
usage |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 | 392 |
| 384 PassRefPtr<StringImpl> replace(UChar, UChar); | 393 PassRefPtr<StringImpl> replace(UChar, UChar); |
| 385 PassRefPtr<StringImpl> replace(UChar, StringImpl*); | 394 PassRefPtr<StringImpl> replace(UChar, StringImpl*); |
| 386 ALWAYS_INLINE PassRefPtr<StringImpl> replace(UChar pattern, const char* repl
acement, unsigned replacementLength) { return replace(pattern, reinterpret_cast<
const LChar*>(replacement), replacementLength); } | 395 ALWAYS_INLINE PassRefPtr<StringImpl> replace(UChar pattern, const char* repl
acement, unsigned replacementLength) { return replace(pattern, reinterpret_cast<
const LChar*>(replacement), replacementLength); } |
| 387 PassRefPtr<StringImpl> replace(UChar, const LChar*, unsigned replacementLeng
th); | 396 PassRefPtr<StringImpl> replace(UChar, const LChar*, unsigned replacementLeng
th); |
| 388 PassRefPtr<StringImpl> replace(UChar, const UChar*, unsigned replacementLeng
th); | 397 PassRefPtr<StringImpl> replace(UChar, const UChar*, unsigned replacementLeng
th); |
| 389 PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*); | 398 PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*); |
| 390 PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*); | 399 PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*); |
| 391 PassRefPtr<StringImpl> upconvertedString(); | 400 PassRefPtr<StringImpl> upconvertedString(); |
| 392 | 401 |
| 402 #if USE(CF) |
| 403 RetainPtr<CFStringRef> createCFString(); |
| 404 #endif |
| 405 #ifdef __OBJC__ |
| 406 operator NSString*(); |
| 407 #endif |
| 408 |
| 393 #ifdef STRING_STATS | 409 #ifdef STRING_STATS |
| 394 ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; } | 410 ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; } |
| 395 #endif | 411 #endif |
| 396 | 412 |
| 397 private: | 413 private: |
| 398 template<typename CharType> static size_t allocationSize(unsigned length) | 414 template<typename CharType> static size_t allocationSize(unsigned length) |
| 399 { | 415 { |
| 400 RELEASE_ASSERT(length <= ((std::numeric_limits<unsigned>::max() - sizeof
(StringImpl)) / sizeof(CharType))); | 416 RELEASE_ASSERT(length <= ((std::numeric_limits<unsigned>::max() - sizeof
(StringImpl)) / sizeof(CharType))); |
| 401 return sizeof(StringImpl) + length * sizeof(CharType); | 417 return sizeof(StringImpl) + length * sizeof(CharType); |
| 402 } | 418 } |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 } | 731 } |
| 716 | 732 |
| 717 using WTF::StringImpl; | 733 using WTF::StringImpl; |
| 718 using WTF::equal; | 734 using WTF::equal; |
| 719 using WTF::equalNonNull; | 735 using WTF::equalNonNull; |
| 720 using WTF::TextCaseSensitivity; | 736 using WTF::TextCaseSensitivity; |
| 721 using WTF::TextCaseSensitive; | 737 using WTF::TextCaseSensitive; |
| 722 using WTF::TextCaseInsensitive; | 738 using WTF::TextCaseInsensitive; |
| 723 | 739 |
| 724 #endif | 740 #endif |
| OLD | NEW |