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

Unified Diff: base/file_util.h

Issue 9316004: Move common file path related methods between chrome & content to file_util. I reduced the 4 meth... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 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 | « no previous file | base/file_util.cc » ('j') | base/file_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | base/file_util.cc » ('j') | base/file_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698