Index: base/files/file_path.h |
diff --git a/base/files/file_path.h b/base/files/file_path.h |
index feb5f896687fa3e01bff31f006ef179b6919d799..0ac91bf873a6275ad8713ef97d98fef730880538 100644 |
--- a/base/files/file_path.h |
+++ b/base/files/file_path.h |
@@ -147,6 +147,12 @@ class FilePath { |
// A special path component meaning "this directory." |
static const CharType kCurrentDirectory[]; |
+ // A special path component meaning "the parent directory." |
+ static const CharType kParentDirectory[]; |
+ |
+ // The character used to identify a file extension. |
+ static const CharType kExtensionSeparator; |
+ |
FilePath(); |
FilePath(const FilePath& that); |
explicit FilePath(const StringType& path); |
@@ -184,6 +190,14 @@ class FilePath { |
// this is the only situation in which BaseName will return an absolute path. |
FilePath BaseName() const WARN_UNUSED_RESULT; |
+ // Returns the path's file extension. This does not have a special case for |
+ // common double extensions, so FinalExtension() of "foo.tar.gz" is simply |
+ // ".gz". If there is no extension, "" will be returned. |
+ StringType FinalExtension() const WARN_UNUSED_RESULT; |
+ |
+ // Returns a FilePath with FinalExtension() removed. |
+ FilePath RemoveFinalExtension() const WARN_UNUSED_RESULT; |
+ |
// Returns a FilePath by appending a separator and the supplied path |
// component to this object's path. Append takes care to avoid adding |
// excessive separators if this object's path already ends with a separator. |