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

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

Issue 2508953003: WTF: Add comments and tests for Unicode aware case-insensitive string operations. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringBuilder.h ('k') | third_party/WebKit/Source/wtf/text/StringView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/StringImpl.h
diff --git a/third_party/WebKit/Source/wtf/text/StringImpl.h b/third_party/WebKit/Source/wtf/text/StringImpl.h
index 2df9c7ea03b19b9f0f04704fdfbef63cfd819aef..18a3519a9883a563e76de8f946ce32b0632d7c22 100644
--- a/third_party/WebKit/Source/wtf/text/StringImpl.h
+++ b/third_party/WebKit/Source/wtf/text/StringImpl.h
@@ -51,6 +51,10 @@ class RetainPtr;
enum TextCaseSensitivity {
TextCaseSensitive,
TextCaseASCIIInsensitive,
+
+ // Unicode aware case insensitive matching. Non-ASCII characters might match
+ // to ASCII characters. This flag is rarely used to implement web platform
+ // features.
TextCaseInsensitive
};
@@ -384,6 +388,9 @@ class WTF_EXPORT StringImpl {
// Find substrings.
size_t find(const StringView&, unsigned index = 0);
+ // Unicode aware case insensitive string matching. Non-ASCII characters might
+ // match to ASCII characters. This function is rarely used to implement web
+ // platform features.
size_t findIgnoringCase(const StringView&, unsigned index = 0);
size_t findIgnoringASCIICase(const StringView&, unsigned index = 0);
@@ -543,12 +550,14 @@ ALWAYS_INLINE bool equal(const UChar* a, const LChar* b, unsigned length) {
return equal(b, a, length);
}
+// Unicode aware case insensitive string matching. Non-ASCII characters might
+// match to ASCII characters. These functions are rarely used to implement web
+// platform features.
WTF_EXPORT bool equalIgnoringCase(const LChar*, const LChar*, unsigned length);
WTF_EXPORT bool equalIgnoringCase(const UChar*, const LChar*, unsigned length);
inline bool equalIgnoringCase(const LChar* a, const UChar* b, unsigned length) {
return equalIgnoringCase(b, a, length);
}
-
WTF_EXPORT bool equalIgnoringCase(const UChar*, const UChar*, unsigned length);
WTF_EXPORT bool equalIgnoringNullity(StringImpl*, StringImpl*);
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringBuilder.h ('k') | third_party/WebKit/Source/wtf/text/StringView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698