diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-13 20:22:14 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-13 20:23:37 +0000 |
commit | e3177dd5063e419cb181cf6a45d3ff94cb0feebd (patch) | |
tree | 9eb2bd0b85941a0586a1a7185ed151689a0032f9 /base/file_util_mac.mm | |
parent | 7fa443fda5ddbf8e83e1967931f115f5394d16aa (diff) | |
download | chromium_src-e3177dd5063e419cb181cf6a45d3ff94cb0feebd.zip chromium_src-e3177dd5063e419cb181cf6a45d3ff94cb0feebd.tar.gz chromium_src-e3177dd5063e419cb181cf6a45d3ff94cb0feebd.tar.bz2 |
Move file_util to base/files/ directory.
This updates the includes in base but leaves a forwarding header for the rest of the project for now.
R=yzshen@chromium.org
Review URL: https://codereview.chromium.org/468253002
Cr-Commit-Position: refs/heads/master@{#289360}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289360 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_mac.mm')
-rw-r--r-- | base/file_util_mac.mm | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/base/file_util_mac.mm b/base/file_util_mac.mm deleted file mode 100644 index 4aa6d55..0000000 --- a/base/file_util_mac.mm +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/file_util.h" - -#import <Foundation/Foundation.h> -#include <copyfile.h> - -#include "base/basictypes.h" -#include "base/files/file_path.h" -#include "base/mac/foundation_util.h" -#include "base/strings/string_util.h" -#include "base/threading/thread_restrictions.h" - -namespace base { -namespace internal { - -bool CopyFileUnsafe(const FilePath& from_path, const FilePath& to_path) { - ThreadRestrictions::AssertIOAllowed(); - return (copyfile(from_path.value().c_str(), - to_path.value().c_str(), NULL, COPYFILE_DATA) == 0); -} - -} // namespace internal - -bool GetTempDir(base::FilePath* path) { - NSString* tmp = NSTemporaryDirectory(); - if (tmp == nil) - return false; - *path = base::mac::NSStringToFilePath(tmp); - return true; -} - -FilePath GetHomeDir() { - NSString* tmp = NSHomeDirectory(); - if (tmp != nil) { - FilePath mac_home_dir = base::mac::NSStringToFilePath(tmp); - if (!mac_home_dir.empty()) - return mac_home_dir; - } - - // Fall back on temp dir if no home directory is defined. - FilePath rv; - if (GetTempDir(&rv)) - return rv; - - // Last resort. - return FilePath("/tmp"); -} - -} // namespace base |