Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: sky/engine/wtf/text/StringImpl.h

Issue 714393002: Remove support for MSVC (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
43 namespace WTF { 35 namespace WTF {
44 36
45 struct AlreadyHashed; 37 struct AlreadyHashed;
46 struct CStringTranslator; 38 struct CStringTranslator;
47 template<typename CharacterType> struct HashAndCharactersTranslator; 39 template<typename CharacterType> struct HashAndCharactersTranslator;
48 struct HashAndUTF8CharactersTranslator; 40 struct HashAndUTF8CharactersTranslator;
49 struct LCharBufferTranslator; 41 struct LCharBufferTranslator;
50 struct CharBufferFromLiteralDataTranslator; 42 struct CharBufferFromLiteralDataTranslator;
51 struct SubstringTranslator; 43 struct SubstringTranslator;
52 struct UCharBufferTranslator; 44 struct UCharBufferTranslator;
53 template<typename> class RetainPtr;
54 45
55 enum TextCaseSensitivity { TextCaseSensitive, TextCaseInsensitive }; 46 enum TextCaseSensitivity { TextCaseSensitive, TextCaseInsensitive };
56 47
57 enum StripBehavior { StripExtraWhiteSpace, DoNotStripWhiteSpace }; 48 enum StripBehavior { StripExtraWhiteSpace, DoNotStripWhiteSpace };
58 49
59 typedef bool (*CharacterMatchFunctionPtr)(UChar); 50 typedef bool (*CharacterMatchFunctionPtr)(UChar);
60 typedef bool (*IsWhiteSpaceFunctionPtr)(UChar); 51 typedef bool (*IsWhiteSpaceFunctionPtr)(UChar);
61 typedef HashMap<unsigned, StringImpl*, AlreadyHashed> StaticStringsTable; 52 typedef HashMap<unsigned, StringImpl*, AlreadyHashed> StaticStringsTable;
62 53
63 // Define STRING_STATS to turn on run time statistics of string sizes and memory usage 54 // 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
392 383
393 PassRefPtr<StringImpl> replace(UChar, UChar); 384 PassRefPtr<StringImpl> replace(UChar, UChar);
394 PassRefPtr<StringImpl> replace(UChar, StringImpl*); 385 PassRefPtr<StringImpl> replace(UChar, StringImpl*);
395 ALWAYS_INLINE PassRefPtr<StringImpl> replace(UChar pattern, const char* repl acement, unsigned replacementLength) { return replace(pattern, reinterpret_cast< const LChar*>(replacement), replacementLength); } 386 ALWAYS_INLINE PassRefPtr<StringImpl> replace(UChar pattern, const char* repl acement, unsigned replacementLength) { return replace(pattern, reinterpret_cast< const LChar*>(replacement), replacementLength); }
396 PassRefPtr<StringImpl> replace(UChar, const LChar*, unsigned replacementLeng th); 387 PassRefPtr<StringImpl> replace(UChar, const LChar*, unsigned replacementLeng th);
397 PassRefPtr<StringImpl> replace(UChar, const UChar*, unsigned replacementLeng th); 388 PassRefPtr<StringImpl> replace(UChar, const UChar*, unsigned replacementLeng th);
398 PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*); 389 PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*);
399 PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*); 390 PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*);
400 PassRefPtr<StringImpl> upconvertedString(); 391 PassRefPtr<StringImpl> upconvertedString();
401 392
402 #if USE(CF)
403 RetainPtr<CFStringRef> createCFString();
404 #endif
405 #ifdef __OBJC__
406 operator NSString*();
407 #endif
408
409 #ifdef STRING_STATS 393 #ifdef STRING_STATS
410 ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; } 394 ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; }
411 #endif 395 #endif
412 396
413 private: 397 private:
414 template<typename CharType> static size_t allocationSize(unsigned length) 398 template<typename CharType> static size_t allocationSize(unsigned length)
415 { 399 {
416 RELEASE_ASSERT(length <= ((std::numeric_limits<unsigned>::max() - sizeof (StringImpl)) / sizeof(CharType))); 400 RELEASE_ASSERT(length <= ((std::numeric_limits<unsigned>::max() - sizeof (StringImpl)) / sizeof(CharType)));
417 return sizeof(StringImpl) + length * sizeof(CharType); 401 return sizeof(StringImpl) + length * sizeof(CharType);
418 } 402 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 } 715 }
732 716
733 using WTF::StringImpl; 717 using WTF::StringImpl;
734 using WTF::equal; 718 using WTF::equal;
735 using WTF::equalNonNull; 719 using WTF::equalNonNull;
736 using WTF::TextCaseSensitivity; 720 using WTF::TextCaseSensitivity;
737 using WTF::TextCaseSensitive; 721 using WTF::TextCaseSensitive;
738 using WTF::TextCaseInsensitive; 722 using WTF::TextCaseInsensitive;
739 723
740 #endif 724 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698