Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 | 23 |
| 24 #include "webrtc/base/checks.h" | 24 #include "webrtc/base/checks.h" |
| 25 #include "webrtc/base/constructormagic.h" | 25 #include "webrtc/base/constructormagic.h" |
| 26 #include "webrtc/base/platform_file.h" | 26 #include "webrtc/base/platform_file.h" |
| 27 | 27 |
| 28 namespace rtc { | 28 namespace rtc { |
| 29 | 29 |
| 30 class FileStream; | 30 class FileStream; |
| 31 class Pathname; | 31 class Pathname; |
| 32 | 32 |
| 33 ////////////////////////// | |
| 34 // Directory Iterator // | |
| 35 ////////////////////////// | |
| 36 | |
| 37 // A DirectoryIterator is created with a given directory. It originally points | 33 // A DirectoryIterator is created with a given directory. It originally points |
| 38 // to the first file in the directory, and can be advanecd with Next(). This | 34 // to the first file in the directory, and can be advanecd with Next(). This |
| 39 // allows you to get information about each file. | 35 // allows you to get information about each file. |
| 40 | |
| 41 class DirectoryIterator { | 36 class DirectoryIterator { |
| 42 friend class Filesystem; | 37 friend class Filesystem; |
| 43 public: | 38 public: |
| 44 // Constructor | 39 // Constructor |
| 45 DirectoryIterator(); | 40 DirectoryIterator(); |
| 46 // Destructor | 41 // Destructor |
| 47 virtual ~DirectoryIterator(); | 42 virtual ~DirectoryIterator(); |
| 48 | 43 |
| 49 // Starts traversing a directory | 44 // Starts traversing a directory and returns true if the directory exists and |
| 50 // dir is the directory to traverse | 45 // is valid. |dir| is the directory to traverse. The iterator will point to |
| 51 // returns true if the directory exists and is valid | 46 // the first entry in the directory. |
| 52 // The iterator will point to the first entry in the directory | 47 virtual bool Iterate(const Pathname &dir); |
| 53 virtual bool Iterate(const Pathname &path); | |
| 54 | 48 |
| 55 // Advances to the next file | 49 // Advances to the next file and returns true if there were more files in the |
| 56 // returns true if there were more files in the directory. | 50 // directory. |
| 57 virtual bool Next(); | 51 virtual bool Next(); |
| 58 | 52 |
| 59 // returns true if the file currently pointed to is a directory | 53 // Returns true if the file currently pointed to is a directory. |
| 60 virtual bool IsDirectory() const; | 54 virtual bool IsDirectory() const; |
| 61 | 55 |
| 62 // returns the name of the file currently pointed to | 56 // Returns the name of the file currently pointed to. |
| 63 virtual std::string Name() const; | 57 virtual std::string Name() const; |
|
kwiberg-webrtc
2017/05/29 12:11:36
Please don't clean up code that your CL otherwise
AleBzk
2017/05/29 13:04:48
Yup. This was a left over from a previous PS in wh
| |
| 64 | 58 |
| 65 private: | 59 private: |
| 66 std::string directory_; | 60 std::string directory_; |
| 67 #if defined(WEBRTC_WIN) | 61 #if defined(WEBRTC_WIN) |
| 68 WIN32_FIND_DATA data_; | 62 WIN32_FIND_DATA data_; |
| 69 HANDLE handle_; | 63 HANDLE handle_; |
| 70 #else | 64 #else |
| 71 DIR *dir_; | 65 DIR *dir_; |
| 72 struct dirent *dirent_; | 66 struct dirent *dirent_; |
| 73 struct stat stat_; | 67 struct stat stat_; |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 247 private: | 241 private: |
| 248 static FilesystemInterface* default_filesystem_; | 242 static FilesystemInterface* default_filesystem_; |
| 249 | 243 |
| 250 static FilesystemInterface *EnsureDefaultFilesystem(); | 244 static FilesystemInterface *EnsureDefaultFilesystem(); |
| 251 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem); | 245 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem); |
| 252 }; | 246 }; |
| 253 | 247 |
| 254 } // namespace rtc | 248 } // namespace rtc |
| 255 | 249 |
| 256 #endif // WEBRTC_BASE_FILEUTILS_H_ | 250 #endif // WEBRTC_BASE_FILEUTILS_H_ |
| OLD | NEW |