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

Unified Diff: runtime/bin/directory.h

Issue 12638039: dart:io | Add "followLinks" optional parameter to Directory.list, let it return Link objects when f… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Switch from Stream.reduce to Completer in link_test. Created 7 years, 9 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
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/directory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory.h
diff --git a/runtime/bin/directory.h b/runtime/bin/directory.h
index 87bea9f540c100964dbb4b806b7e315b2b970c5d..331b4c4fbdbb610e6fb7707a7fa23268cf901599 100644
--- a/runtime/bin/directory.h
+++ b/runtime/bin/directory.h
@@ -16,6 +16,7 @@ class DirectoryListing {
virtual ~DirectoryListing() {}
virtual bool HandleDirectory(char* dir_name) = 0;
virtual bool HandleFile(char* file_name) = 0;
+ virtual bool HandleLink(char* file_name) = 0;
virtual bool HandleError(const char* dir_name) = 0;
};
@@ -25,8 +26,9 @@ class AsyncDirectoryListing : public DirectoryListing {
enum Response {
kListFile = 0,
kListDirectory = 1,
- kListError = 2,
- kListDone = 3
+ kListLink = 2,
+ kListError = 3,
+ kListDone = 4
};
explicit AsyncDirectoryListing(Dart_Port response_port)
@@ -34,6 +36,7 @@ class AsyncDirectoryListing : public DirectoryListing {
virtual ~AsyncDirectoryListing() {}
virtual bool HandleDirectory(char* dir_name);
virtual bool HandleFile(char* file_name);
+ virtual bool HandleLink(char* file_name);
virtual bool HandleError(const char* dir_name);
private:
@@ -53,10 +56,13 @@ class SyncDirectoryListing: public DirectoryListing {
DartUtils::GetDartClass(DartUtils::kIOLibURL, "Directory");
file_class_ =
DartUtils::GetDartClass(DartUtils::kIOLibURL, "File");
+ link_class_ =
+ DartUtils::GetDartClass(DartUtils::kIOLibURL, "Link");
}
virtual ~SyncDirectoryListing() {}
virtual bool HandleDirectory(char* dir_name);
virtual bool HandleFile(char* file_name);
+ virtual bool HandleLink(char* file_name);
virtual bool HandleError(const char* dir_name);
private:
@@ -64,6 +70,7 @@ class SyncDirectoryListing: public DirectoryListing {
Dart_Handle add_string_;
Dart_Handle directory_class_;
Dart_Handle file_class_;
+ Dart_Handle link_class_;
DISALLOW_IMPLICIT_CONSTRUCTORS(SyncDirectoryListing);
};
@@ -90,6 +97,7 @@ class Directory {
static bool List(const char* path,
bool recursive,
+ bool follow_links,
DirectoryListing* listing);
static ExistsResult Exists(const char* path);
static char* Current();
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/directory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698