| 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 #ifndef BASE_FILES_FILE_ENUMERATOR_H_ | 5 #ifndef BASE_FILES_FILE_ENUMERATOR_H_ |
| 6 #define BASE_FILES_FILE_ENUMERATOR_H_ | 6 #define BASE_FILES_FILE_ENUMERATOR_H_ |
| 7 | 7 |
| 8 #include <stack> | 8 #include <stack> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 // The name of the file. This will not include any path information. This | 47 // The name of the file. This will not include any path information. This |
| 48 // is in constrast to the value returned by FileEnumerator.Next() which | 48 // is in constrast to the value returned by FileEnumerator.Next() which |
| 49 // includes the |root_path| passed into the FileEnumerator constructor. | 49 // includes the |root_path| passed into the FileEnumerator constructor. |
| 50 FilePath GetName() const; | 50 FilePath GetName() const; |
| 51 | 51 |
| 52 int64 GetSize() const; | 52 int64 GetSize() const; |
| 53 Time GetLastModifiedTime() const; | 53 Time GetLastModifiedTime() const; |
| 54 | 54 |
| 55 #if defined(OS_WIN) | 55 #if defined(OS_WIN) |
| 56 // Note that the cAlternateFileName (used to hold the "short" 8.3 name) |
| 57 // of the WIN32_FIND_DATA will be empty. Since we don't use short file |
| 58 // names, we tell Windows to omit it which speeds up the query slightly. |
| 56 const WIN32_FIND_DATA& find_data() const { return find_data_; } | 59 const WIN32_FIND_DATA& find_data() const { return find_data_; } |
| 57 #elif defined(OS_POSIX) | 60 #elif defined(OS_POSIX) |
| 58 const struct stat& stat() const { return stat_; } | 61 const struct stat& stat() const { return stat_; } |
| 59 #endif | 62 #endif |
| 60 | 63 |
| 61 private: | 64 private: |
| 62 friend class FileEnumerator; | 65 friend class FileEnumerator; |
| 63 | 66 |
| 64 #if defined(OS_WIN) | 67 #if defined(OS_WIN) |
| 65 WIN32_FIND_DATA find_data_; | 68 WIN32_FIND_DATA find_data_; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // A stack that keeps track of which subdirectories we still need to | 150 // A stack that keeps track of which subdirectories we still need to |
| 148 // enumerate in the breadth-first search. | 151 // enumerate in the breadth-first search. |
| 149 std::stack<FilePath> pending_paths_; | 152 std::stack<FilePath> pending_paths_; |
| 150 | 153 |
| 151 DISALLOW_COPY_AND_ASSIGN(FileEnumerator); | 154 DISALLOW_COPY_AND_ASSIGN(FileEnumerator); |
| 152 }; | 155 }; |
| 153 | 156 |
| 154 } // namespace base | 157 } // namespace base |
| 155 | 158 |
| 156 #endif // BASE_FILES_FILE_ENUMERATOR_H_ | 159 #endif // BASE_FILES_FILE_ENUMERATOR_H_ |
| OLD | NEW |