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

Side by Side Diff: third_party/WebKit/Source/wtf/text/AtomicString.h

Issue 2225173002: Use StringView for String::find. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing null check. Created 4 years, 4 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/StringImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 unsigned length() const { return m_string.length(); } 72 unsigned length() const { return m_string.length(); }
73 73
74 UChar operator[](unsigned i) const { return m_string[i]; } 74 UChar operator[](unsigned i) const { return m_string[i]; }
75 75
76 bool contains(UChar c) const { return m_string.contains(c); } 76 bool contains(UChar c) const { return m_string.contains(c); }
77 bool contains(const LChar* s, TextCaseSensitivity caseSensitivity = TextCase Sensitive) const 77 bool contains(const LChar* s, TextCaseSensitivity caseSensitivity = TextCase Sensitive) const
78 { return m_string.contains(s, caseSensitivity); } 78 { return m_string.contains(s, caseSensitivity); }
79 bool contains(const String& s, TextCaseSensitivity caseSensitivity = TextCas eSensitive) const 79 bool contains(const String& s, TextCaseSensitivity caseSensitivity = TextCas eSensitive) const
80 { return m_string.contains(s, caseSensitivity); } 80 { return m_string.contains(s, caseSensitivity); }
81 81
82 size_t find(UChar c, size_t start = 0) const { return m_string.find(c, start ); } 82 // Find characters.
83 size_t find(UChar c, unsigned start = 0) const
84 { return m_string.find(c, start); }
85 size_t find(LChar c, unsigned start = 0) const
86 { return m_string.find(c, start); }
87 size_t find(char c, unsigned start = 0) const { return find(static_cast<LCha r>(c), start); }
83 size_t find(CharacterMatchFunctionPtr matchFunction, unsigned start = 0) con st 88 size_t find(CharacterMatchFunctionPtr matchFunction, unsigned start = 0) con st
84 { return m_string.find(matchFunction, start); } 89 { return m_string.find(matchFunction, start); }
85 size_t find(const LChar* s, size_t start = 0, TextCaseSensitivity caseSensit ivity = TextCaseSensitive) const 90
86 { return m_string.find(s, start, caseSensitivity); } 91 // Find substrings.
87 size_t find(const String& s, size_t start = 0, TextCaseSensitivity caseSensi tivity = TextCaseSensitive) const 92 size_t find(const StringView& value, unsigned start = 0, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
88 { return m_string.find(s, start, caseSensitivity); } 93 { return m_string.find(value, start, caseSensitivity); }
89 94
90 bool startsWith(const StringView& prefix, TextCaseSensitivity caseSensitivit y = TextCaseSensitive) const 95 bool startsWith(const StringView& prefix, TextCaseSensitivity caseSensitivit y = TextCaseSensitive) const
91 { return m_string.startsWith(prefix, caseSensitivity); } 96 { return m_string.startsWith(prefix, caseSensitivity); }
92 bool startsWith(UChar character) const 97 bool startsWith(UChar character) const
93 { return m_string.startsWith(character); } 98 { return m_string.startsWith(character); }
94 99
95 bool endsWith(const StringView& suffix, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const 100 bool endsWith(const StringView& suffix, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
96 { return m_string.endsWith(suffix, caseSensitivity); } 101 { return m_string.endsWith(suffix, caseSensitivity); }
97 bool endsWith(UChar character) const 102 bool endsWith(UChar character) const
98 { return m_string.endsWith(character); } 103 { return m_string.endsWith(character); }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 using WTF::AtomicString; 209 using WTF::AtomicString;
205 using WTF::nullAtom; 210 using WTF::nullAtom;
206 using WTF::emptyAtom; 211 using WTF::emptyAtom;
207 using WTF::starAtom; 212 using WTF::starAtom;
208 using WTF::xmlAtom; 213 using WTF::xmlAtom;
209 using WTF::xmlnsAtom; 214 using WTF::xmlnsAtom;
210 using WTF::xlinkAtom; 215 using WTF::xlinkAtom;
211 216
212 #include "wtf/text/StringConcatenate.h" 217 #include "wtf/text/StringConcatenate.h"
213 #endif // AtomicString_h 218 #endif // AtomicString_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/StringImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698