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

Unified Diff: third_party/WebKit/Source/wtf/text/WTFString.h

Issue 2230643002: Use StringView for String::findIgnoringCase and findIgnoringASCIICase. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/text/AtomicString.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/WTFString.h
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.h b/third_party/WebKit/Source/wtf/text/WTFString.h
index 25953655260623ad93fb6fd42b9897839cc8d49a..cb0e1c7cac97433fa0c91da305264fa75fc39886 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.h
+++ b/third_party/WebKit/Source/wtf/text/WTFString.h
@@ -182,6 +182,14 @@ public:
size_t find(const StringView& value, unsigned start = 0, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
{ return m_impl ? DISPATCH_CASE_OP(caseSensitivity, m_impl->find, (value, start)) : kNotFound; }
+ // Unicode aware case insensitive string matching.
+ size_t findIgnoringCase(const StringView& value, unsigned start = 0) const
+ { return m_impl ? m_impl->findIgnoringCase(value, start) : kNotFound; }
+
+ // ASCII case insensitive string matching.
+ size_t findIgnoringASCIICase(const StringView& value, unsigned start = 0) const
+ { return m_impl ? m_impl->findIgnoringASCIICase(value, start) : kNotFound; }
+
bool contains(char c) const { return find(c) != kNotFound; }
bool contains(const StringView& value, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
{ return find(value, 0, caseSensitivity) != kNotFound; }
@@ -192,16 +200,6 @@ public:
size_t reverseFind(const String& str, unsigned start = UINT_MAX) const
{ return m_impl ? m_impl->reverseFind(str.impl(), start) : kNotFound; }
- // Case insensitive string matching.
- size_t findIgnoringCase(const LChar* str, unsigned start = 0) const
- { return m_impl ? m_impl->findIgnoringCase(str, start) : kNotFound; }
- size_t findIgnoringCase(const String& str, unsigned start = 0) const
- { return m_impl ? m_impl->findIgnoringCase(str.impl(), start) : kNotFound; }
-
- // ASCII case insensitive string matching.
- size_t findIgnoringASCIICase(const String& str, unsigned start = 0) const
- { return m_impl ? m_impl->findIgnoringASCIICase(str.impl(), start) : kNotFound; }
-
unsigned copyTo(UChar* buffer, unsigned pos, unsigned maxLength) const;
template<typename BufferType>
« no previous file with comments | « third_party/WebKit/Source/wtf/text/AtomicString.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698