| 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 /** | 5 /** |
| 6 * [Process] is used to start new processes using the static | 6 * [Process] is used to start new processes using the static |
| 7 * [start] and [run] methods. | 7 * [start] and [run] methods. |
| 8 */ | 8 */ |
| 9 class Process { | 9 class Process { |
| 10 /** | 10 /** |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 [ProcessOptions options]) { | 44 [ProcessOptions options]) { |
| 45 return _Process.run(executable, arguments, options); | 45 return _Process.run(executable, arguments, options); |
| 46 } | 46 } |
| 47 | 47 |
| 48 /** | 48 /** |
| 49 * Returns an input stream of the process stdout. | 49 * Returns an input stream of the process stdout. |
| 50 * | 50 * |
| 51 * Throws an [UnsupportedOperationException] if the process is | 51 * Throws an [UnsupportedOperationException] if the process is |
| 52 * non-interactive. | 52 * non-interactive. |
| 53 */ | 53 */ |
| 54 abstract InputStream get stdout(); | 54 abstract InputStream get stdout; |
| 55 | 55 |
| 56 /** | 56 /** |
| 57 * Returns an input stream of the process stderr. | 57 * Returns an input stream of the process stderr. |
| 58 * | 58 * |
| 59 * Throws an [UnsupportedOperationException] if the process is | 59 * Throws an [UnsupportedOperationException] if the process is |
| 60 * non-interactive. | 60 * non-interactive. |
| 61 */ | 61 */ |
| 62 abstract InputStream get stderr(); | 62 abstract InputStream get stderr; |
| 63 | 63 |
| 64 /** | 64 /** |
| 65 * Returns an output stream to the process stdin. | 65 * Returns an output stream to the process stdin. |
| 66 * | 66 * |
| 67 * Throws an [UnsupportedOperationException] if the process is | 67 * Throws an [UnsupportedOperationException] if the process is |
| 68 * non-interactive. | 68 * non-interactive. |
| 69 */ | 69 */ |
| 70 abstract OutputStream get stdin(); | 70 abstract OutputStream get stdin; |
| 71 | 71 |
| 72 /** | 72 /** |
| 73 * Set the start handler which gets invoked when the process is | 73 * Set the start handler which gets invoked when the process is |
| 74 * successfully started. | 74 * successfully started. |
| 75 */ | 75 */ |
| 76 abstract void set onStart(void callback()); | 76 abstract void set onStart(void callback()); |
| 77 | 77 |
| 78 /** | 78 /** |
| 79 * Sets an exit handler which gets invoked when the process | 79 * Sets an exit handler which gets invoked when the process |
| 80 * terminates. | 80 * terminates. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 | 115 |
| 116 /** | 116 /** |
| 117 * [ProcessResult] represents the result of running a non-interactive | 117 * [ProcessResult] represents the result of running a non-interactive |
| 118 * process started with [:Process.run:]. | 118 * process started with [:Process.run:]. |
| 119 */ | 119 */ |
| 120 interface ProcessResult { | 120 interface ProcessResult { |
| 121 /** | 121 /** |
| 122 * Exit code for the process. | 122 * Exit code for the process. |
| 123 */ | 123 */ |
| 124 int get exitCode(); | 124 int get exitCode; |
| 125 | 125 |
| 126 /** | 126 /** |
| 127 * Standard output from the process as a string. | 127 * Standard output from the process as a string. |
| 128 */ | 128 */ |
| 129 String get stdout(); | 129 String get stdout; |
| 130 | 130 |
| 131 /** | 131 /** |
| 132 * Standard error from the process as a string. | 132 * Standard error from the process as a string. |
| 133 */ | 133 */ |
| 134 String get stderr(); | 134 String get stderr; |
| 135 } | 135 } |
| 136 | 136 |
| 137 | 137 |
| 138 /** | 138 /** |
| 139 * [ProcessOptions] represents the options that can be supplied when | 139 * [ProcessOptions] represents the options that can be supplied when |
| 140 * starting a process. | 140 * starting a process. |
| 141 */ | 141 */ |
| 142 class ProcessOptions { | 142 class ProcessOptions { |
| 143 /** | 143 /** |
| 144 * The working directory from which the process is started. Note | 144 * The working directory from which the process is started. Note |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 /** | 227 /** |
| 228 * Contains the system message for the process exception if any. | 228 * Contains the system message for the process exception if any. |
| 229 */ | 229 */ |
| 230 final String message; | 230 final String message; |
| 231 | 231 |
| 232 /** | 232 /** |
| 233 * Contains the OS error code for the process exception if any. | 233 * Contains the OS error code for the process exception if any. |
| 234 */ | 234 */ |
| 235 final int errorCode; | 235 final int errorCode; |
| 236 } | 236 } |
| OLD | NEW |