| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 interface File factory _File { | 5 interface File factory _File { |
| 6 /** | 6 /** |
| 7 * Create a File object. | 7 * Create a File object. |
| 8 */ | 8 */ |
| 9 File(String name); | 9 File(String name); |
| 10 | 10 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 * the [setPositionHandler] is called. | 153 * the [setPositionHandler] is called. |
| 154 */ | 154 */ |
| 155 void setPosition(int position); | 155 void setPosition(int position); |
| 156 | 156 |
| 157 /** | 157 /** |
| 158 * Synchronously set the byte position in the file. | 158 * Synchronously set the byte position in the file. |
| 159 */ | 159 */ |
| 160 void setPositionSync(int position); | 160 void setPositionSync(int position); |
| 161 | 161 |
| 162 /** | 162 /** |
| 163 * Truncate (or extend) the file to [length] bytes. When the |
| 164 * operation completes successfully the [truncateHandler] is called. |
| 165 */ |
| 166 void truncate(int length); |
| 167 |
| 168 /** |
| 169 * Synchronously truncate (or extend) the file to [length] bytes. |
| 170 */ |
| 171 void truncateSync(int length); |
| 172 |
| 173 /** |
| 163 * Get the length of the file. When the operation completes the | 174 * Get the length of the file. When the operation completes the |
| 164 * [lengthHandler] is called with the length. | 175 * [lengthHandler] is called with the length. |
| 165 */ | 176 */ |
| 166 void length(); | 177 void length(); |
| 167 | 178 |
| 168 /** | 179 /** |
| 169 * Get the length of the file. When the operation completes the | 180 * Get the length of the file. When the operation completes the |
| 170 * [lengthHandler] is called with the length. | 181 * [lengthHandler] is called with the length. |
| 171 */ | 182 */ |
| 172 int lengthSync(); | 183 int lengthSync(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 void set existsHandler(void handler(bool exists)); | 226 void set existsHandler(void handler(bool exists)); |
| 216 void set createHandler(void handler()); | 227 void set createHandler(void handler()); |
| 217 void set deleteHandler(void handler()); | 228 void set deleteHandler(void handler()); |
| 218 void set openHandler(void handler()); | 229 void set openHandler(void handler()); |
| 219 void set closeHandler(void handler()); | 230 void set closeHandler(void handler()); |
| 220 void set readByteHandler(void handler(int byte)); | 231 void set readByteHandler(void handler(int byte)); |
| 221 void set readListHandler(void handler(int read)); | 232 void set readListHandler(void handler(int read)); |
| 222 void set noPendingWriteHandler(void handler()); | 233 void set noPendingWriteHandler(void handler()); |
| 223 void set positionHandler(void handler(int position)); | 234 void set positionHandler(void handler(int position)); |
| 224 void set setPositionHandler(void handler()); | 235 void set setPositionHandler(void handler()); |
| 236 void set truncateHandler(void handler()); |
| 225 void set lengthHandler(void handler(int length)); | 237 void set lengthHandler(void handler(int length)); |
| 226 void set flushHandler(void handler()); | 238 void set flushHandler(void handler()); |
| 227 void set fullPathHandler(void handler(String path)); | 239 void set fullPathHandler(void handler(String path)); |
| 228 void set errorHandler(void handler(String error)); | 240 void set errorHandler(void handler(String error)); |
| 229 } | 241 } |
| 230 | 242 |
| 231 | 243 |
| 232 interface FileInputStream extends InputStream { | 244 interface FileInputStream extends InputStream { |
| 233 void close(); | 245 void close(); |
| 234 } | 246 } |
| 235 | 247 |
| 236 | 248 |
| 237 interface FileOutputStream extends OutputStream { | 249 interface FileOutputStream extends OutputStream { |
| 238 } | 250 } |
| 239 | 251 |
| 240 | 252 |
| 241 class FileIOException implements Exception { | 253 class FileIOException implements Exception { |
| 242 const FileIOException([String msg = ""]) : message = msg; | 254 const FileIOException([String msg = ""]) : message = msg; |
| 243 String toString() => "FileIOException: $message"; | 255 String toString() => "FileIOException: $message"; |
| 244 final String message; | 256 final String message; |
| 245 } | 257 } |
| OLD | NEW |