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

Unified Diff: runtime/bin/file.h

Issue 9415043: Port async file operations to be using native ports instead or an isolate (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to remove #import from op.dart Created 8 years, 10 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/dartutils.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.h
diff --git a/runtime/bin/file.h b/runtime/bin/file.h
index 16ff0fcac15b316f7d280263f365bd13b72836ae..a1fb90ee98a4b2a4e22c5684d268f1b681fe2515 100644
--- a/runtime/bin/file.h
+++ b/runtime/bin/file.h
@@ -29,6 +29,14 @@ class File {
kWriteTruncate = kWrite | kTruncate
};
+ // These values have to be kept in sync with the mode values of
+ // FileMode.READ, FileMode.WRITE and FileMode.APPEND in file.dart.
+ enum DartFileOpenMode {
+ kDartRead = 0,
+ kDartWrite = 1,
+ kDartAppend = 2
+ };
+
enum StdioHandleType {
kTerminal = 0,
kPipe = 1,
@@ -36,6 +44,26 @@ class File {
kOther = 3
};
+ enum FileRequest {
+ kExistsRequest = 0,
+ kCreateRequest = 1,
+ kDeleteRequest = 2,
+ kOpenRequest = 3,
+ kFullPathRequest = 4,
+ kDirectoryRequest = 5,
+ kCloseRequest = 6,
+ kPositionRequest = 7,
+ kSetPositionRequest = 8,
+ kTruncateRequest = 9,
+ kLengthRequest = 10,
+ kFlushRequest = 11,
+ kReadByteRequest = 12,
+ kWriteByteRequest = 13,
+ kReadListRequest = 14,
+ kWriteListRequest = 15,
+ kWriteStringRequest = 16
+ };
+
~File();
// Read/Write attempt to transfer num_bytes to/from buffer. It returns
@@ -93,6 +121,8 @@ class File {
static const char* StringEscapedPathSeparator();
static StdioHandleType GetStdioHandleType(int fd);
+ static FileOpenMode DartModeToFileMode(DartFileOpenMode mode);
+
private:
File(const char* name, FileHandle* handle) : name_(name), handle_(handle) { }
void Close();
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698