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

Unified Diff: base/file_path.cc

Issue 147017: Allow extension extensions to be case-insensitive. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « base/file_path.h ('k') | base/file_path_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_path.cc
===================================================================
--- base/file_path.cc (revision 19502)
+++ base/file_path.cc (working copy)
@@ -284,6 +284,18 @@
return FilePath(str);
}
+bool FilePath::MatchesExtension(const StringType& extension) const {
+ FilePath::StringType current_extension = Extension();
+
+ if (current_extension.length() != extension.length())
+ return false;
+
+ return std::equal(extension.begin(),
+ extension.end(),
+ current_extension.begin(),
+ CaseInsensitiveCompare<FilePath::CharType>());
+}
+
FilePath FilePath::Append(const StringType& component) const {
DCHECK(!IsPathAbsolute(component));
if (path_.compare(kCurrentDirectory) == 0) {
« no previous file with comments | « base/file_path.h ('k') | base/file_path_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698