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

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

Issue 2226363003: Use StringView for String::reverseFind. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 { return m_string.find(matchFunction, start); } 83 { return m_string.find(matchFunction, start); }
84 84
85 // Find substrings. 85 // Find substrings.
86 size_t find(const StringView& value, unsigned start = 0, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const 86 size_t find(const StringView& value, unsigned start = 0, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
87 { return m_string.find(value, start, caseSensitivity); } 87 { return m_string.find(value, start, caseSensitivity); }
88 88
89 bool contains(char c) const { return find(c) != kNotFound; } 89 bool contains(char c) const { return find(c) != kNotFound; }
90 bool contains(const StringView& value, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const 90 bool contains(const StringView& value, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
91 { return find(value, 0, caseSensitivity) != kNotFound; } 91 { return find(value, 0, caseSensitivity) != kNotFound; }
92 92
93 // Find the last instance of a single character or string.
94 size_t reverseFind(UChar c, unsigned start = UINT_MAX) const
95 { return m_string.reverseFind(c, start); }
96 size_t reverseFind(const StringView& value, unsigned start = UINT_MAX) const
97 { return m_string.reverseFind(value, start); }
98
93 bool startsWith(const StringView& prefix, TextCaseSensitivity caseSensitivit y = TextCaseSensitive) const 99 bool startsWith(const StringView& prefix, TextCaseSensitivity caseSensitivit y = TextCaseSensitive) const
94 { return m_string.startsWith(prefix, caseSensitivity); } 100 { return m_string.startsWith(prefix, caseSensitivity); }
95 bool startsWith(UChar character) const 101 bool startsWith(UChar character) const
96 { return m_string.startsWith(character); } 102 { return m_string.startsWith(character); }
97 103
98 bool endsWith(const StringView& suffix, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const 104 bool endsWith(const StringView& suffix, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
99 { return m_string.endsWith(suffix, caseSensitivity); } 105 { return m_string.endsWith(suffix, caseSensitivity); }
100 bool endsWith(UChar character) const 106 bool endsWith(UChar character) const
101 { return m_string.endsWith(character); } 107 { return m_string.endsWith(character); }
102 108
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 using WTF::AtomicString; 213 using WTF::AtomicString;
208 using WTF::nullAtom; 214 using WTF::nullAtom;
209 using WTF::emptyAtom; 215 using WTF::emptyAtom;
210 using WTF::starAtom; 216 using WTF::starAtom;
211 using WTF::xmlAtom; 217 using WTF::xmlAtom;
212 using WTF::xmlnsAtom; 218 using WTF::xmlnsAtom;
213 using WTF::xlinkAtom; 219 using WTF::xlinkAtom;
214 220
215 #include "wtf/text/StringConcatenate.h" 221 #include "wtf/text/StringConcatenate.h"
216 #endif // AtomicString_h 222 #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