| 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 // This is a copy of the VM's dart:io library. This API is not usable | 5 // This is a copy of the VM's dart:io library. This API is not usable |
| 6 // when running inside a web browser. Nevertheless, Leg provides a | 6 // when running inside a web browser. Nevertheless, Leg provides a |
| 7 // mock version of the dart:io library so that it can statically | 7 // mock version of the dart:io library so that it can statically |
| 8 // analyze programs that use dart:io. | 8 // analyze programs that use dart:io. |
| 9 | 9 |
| 10 // TODO(ahe): Separate API from implementation details. | 10 // TODO(ahe): Separate API from implementation details. |
| 11 | 11 |
| 12 /** | 12 /** |
| 13 * The IO library is used for Dart server applications, | 13 * The IO library is used for Dart server applications, |
| 14 * which run on a stand-alone Dart VM from the command line. | 14 * which run on a stand-alone Dart VM from the command line. |
| 15 * *This library does not work in browser based applications.* | 15 * *This library does not work in browser based applications.* |
| 16 * | 16 * |
| 17 * This library allows you to work with files, directories, | 17 * This library allows you to work with files, directories, |
| 18 * sockets, processes, HTTP servers and clients, and more. | 18 * sockets, processes, HTTP servers and clients, and more. |
| 19 */ | 19 */ |
| 20 #library("dart:io"); | 20 #library("dart:io"); |
| 21 import "dart:coreimpl"; | 21 #import("dart:coreimpl"); |
| 22 import "dart:math"; | 22 #import("dart:math"); |
| 23 import "dart:isolate"; | 23 #import("dart:isolate"); |
| 24 // TODO(ahe): Should Leg support this library? | 24 // TODO(ahe): Should Leg support this library? |
| 25 // #import("dart:nativewrappers"); | 25 // #import("dart:nativewrappers"); |
| 26 import "dart:uri"; | 26 #import("dart:uri"); |
| 27 import "dart:crypto"; | 27 #import("dart:crypto"); |
| 28 import "dart:utf"; | 28 #import("dart:utf"); |
| 29 part '../../../../runtime/bin/buffer_list.dart'; | 29 #source('../../../../runtime/bin/buffer_list.dart'); |
| 30 // Uses native keyword. | 30 // Uses native keyword. |
| 31 //#source('../../../../runtime/bin/common.dart'); | 31 //#source('../../../../runtime/bin/common.dart'); |
| 32 part '../../../../runtime/bin/chunked_stream.dart'; | 32 #source('../../../../runtime/bin/chunked_stream.dart'); |
| 33 part '../../../../runtime/bin/directory.dart'; | 33 #source('../../../../runtime/bin/directory.dart'); |
| 34 // Uses native keyword. | 34 // Uses native keyword. |
| 35 // #source('../../../../runtime/bin/directory_impl.dart'); | 35 // #source('../../../../runtime/bin/directory_impl.dart'); |
| 36 // Uses native keyword. | 36 // Uses native keyword. |
| 37 // #source('../../../../runtime/bin/eventhandler.dart'); | 37 // #source('../../../../runtime/bin/eventhandler.dart'); |
| 38 part '../../../../runtime/bin/file.dart'; | 38 #source('../../../../runtime/bin/file.dart'); |
| 39 // Uses native keyword. | 39 // Uses native keyword. |
| 40 // #source('../../../../runtime/bin/file_impl.dart'); | 40 // #source('../../../../runtime/bin/file_impl.dart'); |
| 41 part '../../../../runtime/bin/http.dart'; | 41 #source('../../../../runtime/bin/http.dart'); |
| 42 part '../../../../runtime/bin/http_impl.dart'; | 42 #source('../../../../runtime/bin/http_impl.dart'); |
| 43 part '../../../../runtime/bin/http_parser.dart'; | 43 #source('../../../../runtime/bin/http_parser.dart'); |
| 44 part '../../../../runtime/bin/http_utils.dart'; | 44 #source('../../../../runtime/bin/http_utils.dart'); |
| 45 part '../../../../runtime/bin/input_stream.dart'; | 45 #source('../../../../runtime/bin/input_stream.dart'); |
| 46 part '../../../../runtime/bin/list_stream.dart'; | 46 #source('../../../../runtime/bin/list_stream.dart'); |
| 47 part '../../../../runtime/bin/list_stream_impl.dart'; | 47 #source('../../../../runtime/bin/list_stream_impl.dart'); |
| 48 part '../../../../runtime/bin/output_stream.dart'; | 48 #source('../../../../runtime/bin/output_stream.dart'); |
| 49 part '../../../../runtime/bin/path.dart'; | 49 #source('../../../../runtime/bin/path.dart'); |
| 50 part '../../../../runtime/bin/path_impl.dart'; | 50 #source('../../../../runtime/bin/path_impl.dart'); |
| 51 part '../../../../runtime/bin/platform.dart'; | 51 #source('../../../../runtime/bin/platform.dart'); |
| 52 // Uses native keyword. | 52 // Uses native keyword. |
| 53 // #source('../../../../runtime/bin/platform_impl.dart'); | 53 // #source('../../../../runtime/bin/platform_impl.dart'); |
| 54 part '../../../../runtime/bin/process.dart'; | 54 #source('../../../../runtime/bin/process.dart'); |
| 55 // Uses native keyword. | 55 // Uses native keyword. |
| 56 // #source('../../../../runtime/bin/process_impl.dart'); | 56 // #source('../../../../runtime/bin/process_impl.dart'); |
| 57 part '../../../../runtime/bin/socket.dart'; | 57 #source('../../../../runtime/bin/socket.dart'); |
| 58 // Uses native keyword. | 58 // Uses native keyword. |
| 59 // #source('../../../../runtime/bin/socket_impl.dart'); | 59 // #source('../../../../runtime/bin/socket_impl.dart'); |
| 60 part '../../../../runtime/bin/socket_stream.dart'; | 60 #source('../../../../runtime/bin/socket_stream.dart'); |
| 61 part '../../../../runtime/bin/socket_stream_impl.dart'; | 61 #source('../../../../runtime/bin/socket_stream_impl.dart'); |
| 62 // Uses native keyword. | 62 // Uses native keyword. |
| 63 // #source('../../../../runtime/bin/stdio.dart'); | 63 // #source('../../../../runtime/bin/stdio.dart'); |
| 64 part '../../../../runtime/bin/stream_util.dart'; | 64 #source('../../../../runtime/bin/stream_util.dart'); |
| 65 part '../../../../runtime/bin/string_stream.dart'; | 65 #source('../../../../runtime/bin/string_stream.dart'); |
| 66 part '../../../../runtime/bin/timer_impl.dart'; | 66 #source('../../../../runtime/bin/timer_impl.dart'); |
| 67 part '../../../../runtime/bin/websocket.dart'; | 67 #source('../../../../runtime/bin/websocket.dart'); |
| 68 part '../../../../runtime/bin/websocket_impl.dart'; | 68 #source('../../../../runtime/bin/websocket_impl.dart'); |
| 69 | 69 |
| 70 /** | 70 /** |
| 71 * An [OSError] object holds information about an error from the | 71 * An [OSError] object holds information about an error from the |
| 72 * operating system. | 72 * operating system. |
| 73 */ | 73 */ |
| 74 class OSError { | 74 class OSError { |
| 75 /** Constant used to indicate that no OS error code is available. */ | 75 /** Constant used to indicate that no OS error code is available. */ |
| 76 static const int noErrorCode = -1; | 76 static const int noErrorCode = -1; |
| 77 | 77 |
| 78 /** Creates an OSError object from a message and an errorCode. */ | 78 /** Creates an OSError object from a message and an errorCode. */ |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 static void set _eventHandler(_EventHandler e) { | 203 static void set _eventHandler(_EventHandler e) { |
| 204 throw new UnsupportedOperationException('_EventHandler._eventhandler = $e'); | 204 throw new UnsupportedOperationException('_EventHandler._eventhandler = $e'); |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 | 207 |
| 208 const InputStream stdin = null; | 208 const InputStream stdin = null; |
| 209 | 209 |
| 210 const OutputStream stdout = null; | 210 const OutputStream stdout = null; |
| 211 | 211 |
| 212 const OutputStream stderr = null; | 212 const OutputStream stderr = null; |
| OLD | NEW |