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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 bool Move(const std::wstring& from_path, const std::wstring& to_path) { | 393 bool Move(const std::wstring& from_path, const std::wstring& to_path) { |
394 return Move(FilePath::FromWStringHack(from_path), | 394 return Move(FilePath::FromWStringHack(from_path), |
395 FilePath::FromWStringHack(to_path)); | 395 FilePath::FromWStringHack(to_path)); |
396 } | 396 } |
397 FILE* OpenFile(const std::wstring& filename, const char* mode) { | 397 FILE* OpenFile(const std::wstring& filename, const char* mode) { |
398 return OpenFile(FilePath::FromWStringHack(filename), mode); | 398 return OpenFile(FilePath::FromWStringHack(filename), mode); |
399 } | 399 } |
400 bool PathExists(const std::wstring& path) { | 400 bool PathExists(const std::wstring& path) { |
401 return PathExists(FilePath::FromWStringHack(path)); | 401 return PathExists(FilePath::FromWStringHack(path)); |
402 } | 402 } |
403 bool PathIsWritable(const std::wstring& path) { | |
404 return PathIsWritable(FilePath::FromWStringHack(path)); | |
405 } | |
406 int ReadFile(const std::wstring& filename, char* data, int size) { | 403 int ReadFile(const std::wstring& filename, char* data, int size) { |
407 return ReadFile(FilePath::FromWStringHack(filename), data, size); | 404 return ReadFile(FilePath::FromWStringHack(filename), data, size); |
408 } | 405 } |
409 bool SetCurrentDirectory(const std::wstring& directory) { | 406 bool SetCurrentDirectory(const std::wstring& directory) { |
410 return SetCurrentDirectory(FilePath::FromWStringHack(directory)); | 407 return SetCurrentDirectory(FilePath::FromWStringHack(directory)); |
411 } | 408 } |
412 void UpOneDirectory(std::wstring* dir) { | 409 void UpOneDirectory(std::wstring* dir) { |
413 FilePath path = FilePath::FromWStringHack(*dir); | 410 FilePath path = FilePath::FromWStringHack(*dir); |
414 FilePath directory = path.DirName(); | 411 FilePath directory = path.DirName(); |
415 // If there is no separator, we will get back kCurrentDirectory. | 412 // If there is no separator, we will get back kCurrentDirectory. |
(...skipping 27 matching lines...) Expand all Loading... |
443 | 440 |
444 bool FileEnumerator::IsDot(const FilePath& path) { | 441 bool FileEnumerator::IsDot(const FilePath& path) { |
445 return FILE_PATH_LITERAL(".") == path.BaseName().value(); | 442 return FILE_PATH_LITERAL(".") == path.BaseName().value(); |
446 } | 443 } |
447 | 444 |
448 bool FileEnumerator::IsDotDot(const FilePath& path) { | 445 bool FileEnumerator::IsDotDot(const FilePath& path) { |
449 return FILE_PATH_LITERAL("..") == path.BaseName().value(); | 446 return FILE_PATH_LITERAL("..") == path.BaseName().value(); |
450 } | 447 } |
451 | 448 |
452 } // namespace | 449 } // namespace |
OLD | NEW |