| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 kCreatedTime = 1, | 66 kCreatedTime = 1, |
| 67 kModifiedTime = 2, | 67 kModifiedTime = 2, |
| 68 kAccessedTime = 3, | 68 kAccessedTime = 3, |
| 69 kMode = 4, | 69 kMode = 4, |
| 70 kSize = 5, | 70 kSize = 5, |
| 71 kStatSize = 6 | 71 kStatSize = 6 |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 ~File(); | 74 ~File(); |
| 75 | 75 |
| 76 intptr_t GetFD(); |
| 77 |
| 76 // Read/Write attempt to transfer num_bytes to/from buffer. It returns | 78 // Read/Write attempt to transfer num_bytes to/from buffer. It returns |
| 77 // the number of bytes read/written. | 79 // the number of bytes read/written. |
| 78 int64_t Read(void* buffer, int64_t num_bytes); | 80 int64_t Read(void* buffer, int64_t num_bytes); |
| 79 int64_t Write(const void* buffer, int64_t num_bytes); | 81 int64_t Write(const void* buffer, int64_t num_bytes); |
| 80 | 82 |
| 81 // ReadFully and WriteFully do attempt to transfer num_bytes to/from | 83 // ReadFully and WriteFully do attempt to transfer num_bytes to/from |
| 82 // the buffer. In the event of short accesses they will loop internally until | 84 // the buffer. In the event of short accesses they will loop internally until |
| 83 // the whole buffer has been transferred or an error occurs. If an error | 85 // the whole buffer has been transferred or an error occurs. If an error |
| 84 // occurred the result will be set to false. | 86 // occurred the result will be set to false. |
| 85 bool ReadFully(void* buffer, int64_t num_bytes); | 87 bool ReadFully(void* buffer, int64_t num_bytes); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // FileHandle is an OS specific class which stores data about the file. | 180 // FileHandle is an OS specific class which stores data about the file. |
| 179 FileHandle* handle_; // OS specific handle for the file. | 181 FileHandle* handle_; // OS specific handle for the file. |
| 180 | 182 |
| 181 DISALLOW_COPY_AND_ASSIGN(File); | 183 DISALLOW_COPY_AND_ASSIGN(File); |
| 182 }; | 184 }; |
| 183 | 185 |
| 184 } // namespace bin | 186 } // namespace bin |
| 185 } // namespace dart | 187 } // namespace dart |
| 186 | 188 |
| 187 #endif // BIN_FILE_H_ | 189 #endif // BIN_FILE_H_ |
| OLD | NEW |