OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 NULL, NULL); | 373 NULL, NULL); |
374 | 374 |
375 if (file_ == base::kInvalidPlatformFileValue) { | 375 if (file_ == base::kInvalidPlatformFileValue) { |
376 DLOG(ERROR) << "Couldn't open " << file_name.value(); | 376 DLOG(ERROR) << "Couldn't open " << file_name.value(); |
377 return false; | 377 return false; |
378 } | 378 } |
379 | 379 |
380 return MapFileToMemoryInternal(); | 380 return MapFileToMemoryInternal(); |
381 } | 381 } |
382 | 382 |
383 // Deprecated functions ---------------------------------------------------- | |
384 | |
385 #if defined(OS_WIN) | |
386 FILE* OpenFile(const std::wstring& filename, const char* mode) { | |
387 return OpenFile(FilePath::FromWStringHack(filename), mode); | |
388 } | |
389 int ReadFile(const std::wstring& filename, char* data, int size) { | |
390 return ReadFile(FilePath::FromWStringHack(filename), data, size); | |
391 } | |
392 int WriteFile(const std::wstring& filename, const char* data, int size) { | |
393 return WriteFile(FilePath::FromWStringHack(filename), data, size); | |
394 } | |
395 #endif // OS_WIN | |
396 | |
397 /////////////////////////////////////////////// | 383 /////////////////////////////////////////////// |
398 // FileEnumerator | 384 // FileEnumerator |
399 // | 385 // |
400 // Note: the main logic is in file_util_<platform>.cc | 386 // Note: the main logic is in file_util_<platform>.cc |
401 | 387 |
402 bool FileEnumerator::ShouldSkip(const FilePath& path) { | 388 bool FileEnumerator::ShouldSkip(const FilePath& path) { |
403 FilePath::StringType basename = path.BaseName().value(); | 389 FilePath::StringType basename = path.BaseName().value(); |
404 return IsDot(path) || (IsDotDot(path) && !(INCLUDE_DOT_DOT & file_type_)); | 390 return IsDot(path) || (IsDotDot(path) && !(INCLUDE_DOT_DOT & file_type_)); |
405 } | 391 } |
406 | 392 |
407 } // namespace | 393 } // namespace |
OLD | NEW |