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

Unified Diff: base/file_util.h

Issue 17243: Add implementations of various extension related methods (derived from file_u... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.h
===================================================================
--- base/file_util.h (revision 7805)
+++ base/file_util.h (working copy)
@@ -75,13 +75,12 @@
// Deprecated. Use FilePath::BaseName instead.
std::wstring GetFilenameFromPath(const std::wstring& path);
-// Returns "jpg" for path "C:\pics\jojo.jpg", or an empty string if
-// the file has no extension.
+// Deprecated compatibility function. Use FilePath::Extension.
FilePath::StringType GetFileExtensionFromPath(const FilePath& path);
// Deprecated temporary compatibility function.
std::wstring GetFileExtensionFromPath(const std::wstring& path);
-// Returns 'jojo' for path "C:\pics\jojo.jpg".
+// Deprecated compatibility function. Use FilePath::RemoveExtension.
std::wstring GetFilenameWithoutExtensionFromPath(const std::wstring& path);
// Returns the directory component of a path, without the trailing
@@ -104,18 +103,15 @@
// Deprecated temporary compatibility function.
bool AbsolutePath(std::wstring* path);
-// Inserts |suffix| after the file name portion of |path| but before the
-// extension.
-// Examples:
-// path == "C:\pics\jojo.jpg" suffix == " (1)", returns "C:\pics\jojo (1).jpg"
-// path == "jojo.jpg" suffix == " (1)", returns "jojo (1).jpg"
-// path == "C:\pics\jojo" suffix == " (1)", returns "C:\pics\jojo (1)"
-// path == "C:\pics.old\jojo" suffix == " (1)", returns "C:\pics.old\jojo (1)"
+// Returns true if this FilePath represents a parent dir of |other|. Both
+// paths are normalized before doing the comparison, but neither |this| nor
+// |other| are modified.
+bool PathContains(const FilePath& path, const FilePath& other);
+
+// Deprecated compatibility function. Use FilePath::InsertBeforeExtension.
void InsertBeforeExtension(FilePath* path, const FilePath::StringType& suffix);
-// Replaces the extension of |file_name| with |extension|. If |file_name|
-// does not have an extension, them |extension| is added. If |extension| is
-// empty, then the extension is removed from |file_name|.
+// Deprecated compatibility function. Use FilePath::ReplaceExtension.
void ReplaceExtension(FilePath* file_name,
const FilePath::StringType& extension);
« no previous file with comments | « base/file_path_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698