| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BIN_FILE_H_ | 5 #ifndef BIN_FILE_H_ |
| 6 #define BIN_FILE_H_ | 6 #define BIN_FILE_H_ |
| 7 | 7 |
| 8 #if defined(_WIN32) | 8 #if defined(_WIN32) |
| 9 typedef signed __int64 int64_t; | 9 typedef signed __int64 int64_t; |
| 10 typedef unsigned __int8 uint8_t; | 10 typedef unsigned __int8 uint8_t; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 kDeleteRequest = 2, | 56 kDeleteRequest = 2, |
| 57 kOpenRequest = 3, | 57 kOpenRequest = 3, |
| 58 kFullPathRequest = 4, | 58 kFullPathRequest = 4, |
| 59 kDirectoryRequest = 5, | 59 kDirectoryRequest = 5, |
| 60 kCloseRequest = 6, | 60 kCloseRequest = 6, |
| 61 kPositionRequest = 7, | 61 kPositionRequest = 7, |
| 62 kSetPositionRequest = 8, | 62 kSetPositionRequest = 8, |
| 63 kTruncateRequest = 9, | 63 kTruncateRequest = 9, |
| 64 kLengthRequest = 10, | 64 kLengthRequest = 10, |
| 65 kLengthFromNameRequest = 11, | 65 kLengthFromNameRequest = 11, |
| 66 kFlushRequest = 12, | 66 kLastModifiedRequest = 12, |
| 67 kReadByteRequest = 13, | 67 kFlushRequest = 13, |
| 68 kWriteByteRequest = 14, | 68 kReadByteRequest = 14, |
| 69 kReadListRequest = 15, | 69 kWriteByteRequest = 15, |
| 70 kWriteListRequest = 16, | 70 kReadListRequest = 16, |
| 71 kWriteStringRequest = 17 | 71 kWriteListRequest = 17, |
| 72 kWriteStringRequest = 18 |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 ~File(); | 75 ~File(); |
| 75 | 76 |
| 76 // Read/Write attempt to transfer num_bytes to/from buffer. It returns | 77 // Read/Write attempt to transfer num_bytes to/from buffer. It returns |
| 77 // the number of bytes read/written. | 78 // the number of bytes read/written. |
| 78 int64_t Read(void* buffer, int64_t num_bytes); | 79 int64_t Read(void* buffer, int64_t num_bytes); |
| 79 int64_t Write(const void* buffer, int64_t num_bytes); | 80 int64_t Write(const void* buffer, int64_t num_bytes); |
| 80 | 81 |
| 81 // ReadFully and WriteFully do attempt to transfer num_bytes to/from | 82 // ReadFully and WriteFully do attempt to transfer num_bytes to/from |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 static File* Open(const char* name, FileOpenMode mode); | 119 static File* Open(const char* name, FileOpenMode mode); |
| 119 | 120 |
| 120 // Create a file object for the specified stdio file descriptor | 121 // Create a file object for the specified stdio file descriptor |
| 121 // (stdin, stout or stderr). | 122 // (stdin, stout or stderr). |
| 122 static File* OpenStdio(int fd); | 123 static File* OpenStdio(int fd); |
| 123 | 124 |
| 124 static bool Exists(const char* name); | 125 static bool Exists(const char* name); |
| 125 static bool Create(const char* name); | 126 static bool Create(const char* name); |
| 126 static bool Delete(const char* name); | 127 static bool Delete(const char* name); |
| 127 static off_t LengthFromName(const char* name); | 128 static off_t LengthFromName(const char* name); |
| 129 static time_t LastModified(const char* name); |
| 128 static bool IsAbsolutePath(const char* pathname); | 130 static bool IsAbsolutePath(const char* pathname); |
| 129 static char* GetCanonicalPath(const char* name); | 131 static char* GetCanonicalPath(const char* name); |
| 130 static char* GetContainingDirectory(char* name); | 132 static char* GetContainingDirectory(char* name); |
| 131 static const char* PathSeparator(); | 133 static const char* PathSeparator(); |
| 132 static const char* StringEscapedPathSeparator(); | 134 static const char* StringEscapedPathSeparator(); |
| 133 static StdioHandleType GetStdioHandleType(int fd); | 135 static StdioHandleType GetStdioHandleType(int fd); |
| 134 | 136 |
| 135 static FileOpenMode DartModeToFileMode(DartFileOpenMode mode); | 137 static FileOpenMode DartModeToFileMode(DartFileOpenMode mode); |
| 136 | 138 |
| 137 static Dart_Port GetServicePort(); | 139 static Dart_Port GetServicePort(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 150 File(const File&); | 152 File(const File&); |
| 151 void operator=(const File&); | 153 void operator=(const File&); |
| 152 | 154 |
| 153 static dart::Mutex mutex_; | 155 static dart::Mutex mutex_; |
| 154 static int service_ports_size_; | 156 static int service_ports_size_; |
| 155 static Dart_Port* service_ports_; | 157 static Dart_Port* service_ports_; |
| 156 static int service_ports_index_; | 158 static int service_ports_index_; |
| 157 }; | 159 }; |
| 158 | 160 |
| 159 #endif // BIN_FILE_H_ | 161 #endif // BIN_FILE_H_ |
| OLD | NEW |