diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-31 23:16:39 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-31 23:16:39 +0000 |
commit | e285afa63ad7aa2d4efdbdde45568d26c7370fb0 (patch) | |
tree | 5d82a8e576bedc37902223eaaf3a7eeb21ee1888 /base/file_util.h | |
parent | aac510a6d64d91040cf589c701575ca09fa3d820 (diff) | |
download | chromium_src-e285afa63ad7aa2d4efdbdde45568d26c7370fb0.zip chromium_src-e285afa63ad7aa2d4efdbdde45568d26c7370fb0.tar.gz chromium_src-e285afa63ad7aa2d4efdbdde45568d26c7370fb0.tar.bz2 |
Move common file path related methods between chrome & content to file_util. I reduced the 4 methods into 3 by only having one GetUniquePathNumber which takes an optional suffix.
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/9316004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.h')
-rw-r--r-- | base/file_util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/base/file_util.h b/base/file_util.h index 384f394..53264c1 100644 --- a/base/file_util.h +++ b/base/file_util.h @@ -388,6 +388,13 @@ BASE_EXPORT bool GetCurrentDirectory(FilePath* path); // 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. |