Index: base/file_util.h |
=================================================================== |
--- base/file_util.h (revision 119906) |
+++ base/file_util.h (working copy) |
@@ -62,6 +62,14 @@ |
// absolute paths before doing the comparison. |
BASE_EXPORT bool ContainsPath(const FilePath& parent, const FilePath& child); |
+// Appends the passed-in |number| between parenthesis to the |path| before |
+// the file extension. |
+BASE_EXPORT void AppendNumberToPath(FilePath* path, int number); |
+ |
+// Appends the passed-in |suffix| to the |path|. |
+BASE_EXPORT FilePath AppendSuffixToPath(const FilePath& path, |
+ const FilePath::StringType& suffix); |
Evan Martin
2012/01/31 21:23:44
Why does one of these take a FilePath* and the oth
|
+ |
//----------------------------------------------------------------------------- |
// Functions that involve filesystem access or modification: |
@@ -388,6 +396,13 @@ |
// Sets the current working directory for the process. |
BASE_EXPORT bool SetCurrentDirectory(const FilePath& path); |
+// Attempts to find a number that can be appended to the |path| to make it |
+// unique. If |path| does not exist, 0 is returned. If it fails to find such |
+// a number, -1 is returned. If |suffix| is not empty, also checks the |
+// existence of it with the given suffix. |
+BASE_EXPORT int GetUniquePathNumber(const FilePath& path, |
+ const FilePath::StringType& suffix); |
+ |
#if defined(OS_POSIX) |
// Test that |path| can only be changed by a given user and members of |
// a given set of groups. |