OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 kTruncateRequest = 9, | 70 kTruncateRequest = 9, |
71 kLengthRequest = 10, | 71 kLengthRequest = 10, |
72 kLengthFromPathRequest = 11, | 72 kLengthFromPathRequest = 11, |
73 kLastModifiedRequest = 12, | 73 kLastModifiedRequest = 12, |
74 kFlushRequest = 13, | 74 kFlushRequest = 13, |
75 kReadByteRequest = 14, | 75 kReadByteRequest = 14, |
76 kWriteByteRequest = 15, | 76 kWriteByteRequest = 15, |
77 kReadRequest = 16, | 77 kReadRequest = 16, |
78 kReadListRequest = 17, | 78 kReadListRequest = 17, |
79 kWriteListRequest = 18, | 79 kWriteListRequest = 18, |
80 kDeleteLinkRequest = 19 | 80 kCreateLinkRequest = 19, |
| 81 kDeleteLinkRequest = 20 |
81 }; | 82 }; |
82 | 83 |
83 ~File(); | 84 ~File(); |
84 | 85 |
85 // Read/Write attempt to transfer num_bytes to/from buffer. It returns | 86 // Read/Write attempt to transfer num_bytes to/from buffer. It returns |
86 // the number of bytes read/written. | 87 // the number of bytes read/written. |
87 int64_t Read(void* buffer, int64_t num_bytes); | 88 int64_t Read(void* buffer, int64_t num_bytes); |
88 int64_t Write(const void* buffer, int64_t num_bytes); | 89 int64_t Write(const void* buffer, int64_t num_bytes); |
89 | 90 |
90 // ReadFully and WriteFully do attempt to transfer num_bytes to/from | 91 // ReadFully and WriteFully do attempt to transfer num_bytes to/from |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 158 |
158 // FileHandle is an OS specific class which stores data about the file. | 159 // FileHandle is an OS specific class which stores data about the file. |
159 FileHandle* handle_; // OS specific handle for the file. | 160 FileHandle* handle_; // OS specific handle for the file. |
160 | 161 |
161 static NativeService file_service_; | 162 static NativeService file_service_; |
162 | 163 |
163 DISALLOW_COPY_AND_ASSIGN(File); | 164 DISALLOW_COPY_AND_ASSIGN(File); |
164 }; | 165 }; |
165 | 166 |
166 #endif // BIN_FILE_H_ | 167 #endif // BIN_FILE_H_ |
OLD | NEW |