| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <io.h> | 8 #include <io.h> |
| 9 #endif | 9 #endif |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 FilePath::StringType dir_prefix(prefix); | 336 FilePath::StringType dir_prefix(prefix); |
| 337 #elif defined(OS_POSIX) | 337 #elif defined(OS_POSIX) |
| 338 FilePath::StringType dir_prefix = WideToUTF8(prefix); | 338 FilePath::StringType dir_prefix = WideToUTF8(prefix); |
| 339 #endif | 339 #endif |
| 340 FilePath temp_path; | 340 FilePath temp_path; |
| 341 if (!CreateNewTempDirectory(dir_prefix, &temp_path)) | 341 if (!CreateNewTempDirectory(dir_prefix, &temp_path)) |
| 342 return false; | 342 return false; |
| 343 *new_temp_path = temp_path.ToWStringHack(); | 343 *new_temp_path = temp_path.ToWStringHack(); |
| 344 return true; | 344 return true; |
| 345 } | 345 } |
| 346 bool CreateTemporaryFileName(std::wstring* temp_file) { | |
| 347 FilePath temp_file_path; | |
| 348 if (!CreateTemporaryFileName(&temp_file_path)) | |
| 349 return false; | |
| 350 *temp_file = temp_file_path.ToWStringHack(); | |
| 351 return true; | |
| 352 } | |
| 353 bool Delete(const std::wstring& path, bool recursive) { | 346 bool Delete(const std::wstring& path, bool recursive) { |
| 354 return Delete(FilePath::FromWStringHack(path), recursive); | 347 return Delete(FilePath::FromWStringHack(path), recursive); |
| 355 } | 348 } |
| 356 bool DirectoryExists(const std::wstring& path) { | 349 bool DirectoryExists(const std::wstring& path) { |
| 357 return DirectoryExists(FilePath::FromWStringHack(path)); | 350 return DirectoryExists(FilePath::FromWStringHack(path)); |
| 358 } | 351 } |
| 359 bool EndsWithSeparator(std::wstring* path) { | 352 bool EndsWithSeparator(std::wstring* path) { |
| 360 return EndsWithSeparator(FilePath::FromWStringHack(*path)); | 353 return EndsWithSeparator(FilePath::FromWStringHack(*path)); |
| 361 } | 354 } |
| 362 bool EndsWithSeparator(const std::wstring& path) { | 355 bool EndsWithSeparator(const std::wstring& path) { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 443 |
| 451 bool FileEnumerator::IsDot(const FilePath& path) { | 444 bool FileEnumerator::IsDot(const FilePath& path) { |
| 452 return FILE_PATH_LITERAL(".") == path.BaseName().value(); | 445 return FILE_PATH_LITERAL(".") == path.BaseName().value(); |
| 453 } | 446 } |
| 454 | 447 |
| 455 bool FileEnumerator::IsDotDot(const FilePath& path) { | 448 bool FileEnumerator::IsDotDot(const FilePath& path) { |
| 456 return FILE_PATH_LITERAL("..") == path.BaseName().value(); | 449 return FILE_PATH_LITERAL("..") == path.BaseName().value(); |
| 457 } | 450 } |
| 458 | 451 |
| 459 } // namespace | 452 } // namespace |
| OLD | NEW |