Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Unified Diff: webrtc/base/fileutils.cc

Issue 2898753002: ReadDirectory() added in webrtc/test/testsupport/fileutils.h (Closed)
Patch Set: commented lines removed Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/base/fileutils.cc
diff --git a/webrtc/base/fileutils.cc b/webrtc/base/fileutils.cc
index a047918901e440818aafb04d1534eaed26c1d738..9b65c20502b76132b20c58cd90fdb49e85ac3b09 100644
--- a/webrtc/base/fileutils.cc
+++ b/webrtc/base/fileutils.cc
@@ -41,7 +41,7 @@ DirectoryIterator::DirectoryIterator()
: handle_(INVALID_HANDLE_VALUE) {
#else
: dir_(nullptr),
- dirent_(nullptr){
+ dirent_(nullptr) {
#endif
}
@@ -117,6 +117,18 @@ std::string DirectoryIterator::Name() const {
#endif
}
+Pathname DirectoryIterator::Path() const {
+ if (IsDirectory()) {
+ // Path to a directory.
+ rtc::Pathname dir(directory_);
+ dir.AppendFolder(Name());
+ return dir;
+ } else {
+ // Path to a file.
+ return rtc::Pathname(directory_, Name());
+ }
+}
+
FilesystemInterface* Filesystem::default_filesystem_ = nullptr;
FilesystemInterface *Filesystem::EnsureDefaultFilesystem() {

Powered by Google App Engine
This is Rietveld 408576698