| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <fstream> | 9 #include <fstream> |
| 10 | 10 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 291 |
| 292 bool CloseFile(FILE* file) { | 292 bool CloseFile(FILE* file) { |
| 293 if (file == NULL) | 293 if (file == NULL) |
| 294 return true; | 294 return true; |
| 295 return fclose(file) == 0; | 295 return fclose(file) == 0; |
| 296 } | 296 } |
| 297 | 297 |
| 298 // Deprecated functions ---------------------------------------------------- | 298 // Deprecated functions ---------------------------------------------------- |
| 299 | 299 |
| 300 bool AbsolutePath(std::wstring* path_str) { | 300 bool AbsolutePath(std::wstring* path_str) { |
| 301 FilePath path(*path_str); | 301 FilePath path(FilePath::FromWStringHack(*path_str)); |
| 302 if (!AbsolutePath(&path)) | 302 if (!AbsolutePath(&path)) |
| 303 return false; | 303 return false; |
| 304 *path_str = path.ToWStringHack(); | 304 *path_str = path.ToWStringHack(); |
| 305 return true; | 305 return true; |
| 306 } | 306 } |
| 307 bool Delete(const std::wstring& path, bool recursive) { | 307 bool Delete(const std::wstring& path, bool recursive) { |
| 308 return Delete(FilePath::FromWStringHack(path), recursive); | 308 return Delete(FilePath::FromWStringHack(path), recursive); |
| 309 } | 309 } |
| 310 bool Move(const std::wstring& from_path, const std::wstring& to_path) { | 310 bool Move(const std::wstring& from_path, const std::wstring& to_path) { |
| 311 return Move(FilePath::FromWStringHack(from_path), | 311 return Move(FilePath::FromWStringHack(from_path), |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 bool GetTempDir(std::wstring* path_str) { | 345 bool GetTempDir(std::wstring* path_str) { |
| 346 FilePath path; | 346 FilePath path; |
| 347 if (!GetTempDir(&path)) | 347 if (!GetTempDir(&path)) |
| 348 return false; | 348 return false; |
| 349 *path_str = path.ToWStringHack(); | 349 *path_str = path.ToWStringHack(); |
| 350 return true; | 350 return true; |
| 351 } | 351 } |
| 352 | 352 |
| 353 } // namespace | 353 } // namespace |
| 354 | 354 |
| OLD | NEW |