summaryrefslogtreecommitdiffstats
path: root/base/file_util_win.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 20:08:54 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 20:08:54 +0000
commit426d1c945bcb1a8479d92a7dd023c34cbbc7a261 (patch)
tree8b6d4ad435be865cc5eae1dacfc3e299436fb596 /base/file_util_win.cc
parent425b55b976d5987b502d2e72e15befedbe2c9662 (diff)
downloadchromium_src-426d1c945bcb1a8479d92a7dd023c34cbbc7a261.zip
chromium_src-426d1c945bcb1a8479d92a7dd023c34cbbc7a261.tar.gz
chromium_src-426d1c945bcb1a8479d92a7dd023c34cbbc7a261.tar.bz2
Move directory creation functions to base namespace.
BUG= Review URL: https://codereview.chromium.org/100573002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_win.cc')
-rw-r--r--base/file_util_win.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index ac35c74..be58630 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -178,7 +178,7 @@ bool CopyDirectory(const FilePath& from_path, const FilePath& to_path,
// Except that Vista fails to do that, and instead do a recursive copy if
// the target directory doesn't exist.
if (base::win::GetVersion() >= base::win::VERSION_VISTA)
- file_util::CreateDirectory(to_path);
+ CreateDirectory(to_path);
else
ShellCopy(from_path, to_path, false);
}
@@ -329,19 +329,9 @@ bool CreateNewTempDirectory(const FilePath::StringType& prefix,
return CreateTemporaryDirInDir(system_temp_dir, prefix, new_temp_path);
}
-} // namespace base
-
-// -----------------------------------------------------------------------------
-
-namespace file_util {
-
-using base::DirectoryExists;
-using base::FilePath;
-using base::kFileShareAll;
-
bool CreateDirectoryAndGetError(const FilePath& full_path,
- base::PlatformFileError* error) {
- base::ThreadRestrictions::AssertIOAllowed();
+ PlatformFileError* error) {
+ ThreadRestrictions::AssertIOAllowed();
// If the path exists, we've succeeded if it's a directory, failed otherwise.
const wchar_t* full_path_str = full_path.value().c_str();
@@ -355,7 +345,7 @@ bool CreateDirectoryAndGetError(const FilePath& full_path,
DLOG(WARNING) << "CreateDirectory(" << full_path_str << "), "
<< "conflicts with existing file.";
if (error) {
- *error = base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY;
+ *error = PLATFORM_FILE_ERROR_NOT_A_DIRECTORY;
}
return false;
}
@@ -368,14 +358,14 @@ bool CreateDirectoryAndGetError(const FilePath& full_path,
FilePath parent_path(full_path.DirName());
if (parent_path.value() == full_path.value()) {
if (error) {
- *error = base::PLATFORM_FILE_ERROR_NOT_FOUND;
+ *error = PLATFORM_FILE_ERROR_NOT_FOUND;
}
return false;
}
if (!CreateDirectoryAndGetError(parent_path, error)) {
DLOG(WARNING) << "Failed to create one of the parent directories.";
if (error) {
- DCHECK(*error != base::PLATFORM_FILE_OK);
+ DCHECK(*error != PLATFORM_FILE_OK);
}
return false;
}
@@ -390,7 +380,7 @@ bool CreateDirectoryAndGetError(const FilePath& full_path,
return true;
} else {
if (error)
- *error = base::LastErrorToPlatformFileError(error_code);
+ *error = LastErrorToPlatformFileError(error_code);
DLOG(WARNING) << "Failed to create directory " << full_path_str
<< ", last error is " << error_code << ".";
return false;
@@ -400,6 +390,16 @@ bool CreateDirectoryAndGetError(const FilePath& full_path,
}
}
+} // namespace base
+
+// -----------------------------------------------------------------------------
+
+namespace file_util {
+
+using base::DirectoryExists;
+using base::FilePath;
+using base::kFileShareAll;
+
// TODO(rkc): Work out if we want to handle NTFS junctions here or not, handle
// them if we do decide to.
bool IsLink(const FilePath& file_path) {