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) { |