| 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 19 matching lines...) Expand all Loading... |
| 30 // | 30 // |
| 31 // Example: | 31 // Example: |
| 32 // | 32 // |
| 33 // base::FileEnumerator enum(my_dir, false, base::FileEnumerator::FILES, | 33 // base::FileEnumerator enum(my_dir, false, base::FileEnumerator::FILES, |
| 34 // FILE_PATH_LITERAL("*.txt")); | 34 // FILE_PATH_LITERAL("*.txt")); |
| 35 // for (base::FilePath name = enum.Next(); !name.empty(); name = enum.Next()) | 35 // for (base::FilePath name = enum.Next(); !name.empty(); name = enum.Next()) |
| 36 // ... | 36 // ... |
| 37 class BASE_EXPORT FileEnumerator { | 37 class BASE_EXPORT FileEnumerator { |
| 38 public: | 38 public: |
| 39 // Note: copy & assign supported. | 39 // Note: copy & assign supported. |
| 40 class BASE_EXPORT FileInfo { | 40 class FileInfo { |
| 41 public: | 41 public: |
| 42 FileInfo(); | 42 FileInfo(); |
| 43 ~FileInfo(); | 43 ~FileInfo(); |
| 44 | 44 |
| 45 bool IsDirectory() const; | 45 bool IsDirectory() const; |
| 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; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // A stack that keeps track of which subdirectories we still need to | 147 // A stack that keeps track of which subdirectories we still need to |
| 148 // enumerate in the breadth-first search. | 148 // enumerate in the breadth-first search. |
| 149 std::stack<FilePath> pending_paths_; | 149 std::stack<FilePath> pending_paths_; |
| 150 | 150 |
| 151 DISALLOW_COPY_AND_ASSIGN(FileEnumerator); | 151 DISALLOW_COPY_AND_ASSIGN(FileEnumerator); |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 } // namespace base | 154 } // namespace base |
| 155 | 155 |
| 156 #endif // BASE_FILES_FILE_ENUMERATOR_H_ | 156 #endif // BASE_FILES_FILE_ENUMERATOR_H_ |
| OLD | NEW |