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

Unified Diff: base/file_util_mac.mm

Issue 8825: Begin the first small step towards using FilePath everywhere: (Closed)
Patch Set: works on windows Created 12 years, 2 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 | « base/file_util_linux.cc ('k') | base/file_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_mac.mm
diff --git a/base/file_util_mac.mm b/base/file_util_mac.mm
index 6770cc6ecd26bcd5fe2c3637aed3a7177bb58e7d..f7f5632cf430c8a2e22ceebfc14a9b7df68d2a97 100644
--- a/base/file_util_mac.mm
+++ b/base/file_util_mac.mm
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
#include <copyfile.h>
+#include "base/file_path.h"
#include "base/logging.h"
#include "base/string_util.h"
@@ -14,18 +15,17 @@ namespace file_util {
const wchar_t kPathSeparator = L'/';
-bool GetTempDir(std::wstring* path) {
+bool GetTempDir(FilePath* path) {
NSString* tmp = NSTemporaryDirectory();
if (tmp == nil)
return false;
- *path = reinterpret_cast<const wchar_t*>(
- [tmp cStringUsingEncoding:NSUTF32StringEncoding]);
+ *path = FilePath([tmp fileSystemRepresentation]);
return true;
}
-bool CopyFile(const std::wstring& from_path, const std::wstring& to_path) {
- return (copyfile(WideToUTF8(from_path).c_str(),
- WideToUTF8(to_path).c_str(), NULL, COPYFILE_ALL) == 0);
+bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
+ return (copyfile(from_path.value().c_str(),
+ to_path.value().c_str(), NULL, COPYFILE_ALL) == 0);
}
} // namespace
« no previous file with comments | « base/file_util_linux.cc ('k') | base/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698