OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file contains utility functions for dealing with the local | 5 // This file contains utility functions for dealing with the local |
6 // filesystem. | 6 // filesystem. |
7 | 7 |
8 #ifndef BASE_FILE_UTIL_H_ | 8 #ifndef BASE_FILE_UTIL_H_ |
9 #define BASE_FILE_UTIL_H_ | 9 #define BASE_FILE_UTIL_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 419 |
420 typedef scoped_ptr_malloc<FILE, ScopedFILEClose> ScopedFILE; | 420 typedef scoped_ptr_malloc<FILE, ScopedFILEClose> ScopedFILE; |
421 | 421 |
422 #if defined(OS_POSIX) | 422 #if defined(OS_POSIX) |
423 // A class to handle auto-closing of FDs. | 423 // A class to handle auto-closing of FDs. |
424 class ScopedFDClose { | 424 class ScopedFDClose { |
425 public: | 425 public: |
426 inline void operator()(int* x) const { | 426 inline void operator()(int* x) const { |
427 if (x && *x >= 0) { | 427 if (x && *x >= 0) { |
428 if (HANDLE_EINTR(close(*x)) < 0) | 428 if (HANDLE_EINTR(close(*x)) < 0) |
429 PLOG(ERROR) << "close"; | 429 DPLOG(ERROR) << "close"; |
430 } | 430 } |
431 } | 431 } |
432 }; | 432 }; |
433 | 433 |
434 typedef scoped_ptr_malloc<int, ScopedFDClose> ScopedFD; | 434 typedef scoped_ptr_malloc<int, ScopedFDClose> ScopedFD; |
435 #endif // OS_POSIX | 435 #endif // OS_POSIX |
436 | 436 |
437 // A class for enumerating the files in a provided path. The order of the | 437 // A class for enumerating the files in a provided path. The order of the |
438 // results is not guaranteed. | 438 // results is not guaranteed. |
439 // | 439 // |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type); | 628 BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type); |
629 #endif | 629 #endif |
630 | 630 |
631 } // namespace file_util | 631 } // namespace file_util |
632 | 632 |
633 // Deprecated functions have been moved to this separate header file, | 633 // Deprecated functions have been moved to this separate header file, |
634 // which must be included last after all the above definitions. | 634 // which must be included last after all the above definitions. |
635 #include "base/file_util_deprecated.h" | 635 #include "base/file_util_deprecated.h" |
636 | 636 |
637 #endif // BASE_FILE_UTIL_H_ | 637 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |