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 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 class _Platform { | 7 class _Platform { |
8 external static int _numberOfProcessors(); | 8 external static int _numberOfProcessors(); |
9 external static String _pathSeparator(); | 9 external static String _pathSeparator(); |
10 external static String _operatingSystem(); | 10 external static String _operatingSystem(); |
11 external static _localHostname(); | 11 external static _localHostname(); |
12 external static _executable(); | 12 external static _executable(); |
13 external static _resolvedExecutable(); | 13 external static _resolvedExecutable(); |
14 external static bool _ansiSupported(); | |
15 | 14 |
16 /** | 15 /** |
17 * Retrieve the entries of the process environment. | 16 * Retrieve the entries of the process environment. |
18 * | 17 * |
19 * The result is an [Iterable] of strings, where each string represents | 18 * The result is an [Iterable] of strings, where each string represents |
20 * an environment entry. | 19 * an environment entry. |
21 * | 20 * |
22 * Environment entries should be strings containing | 21 * Environment entries should be strings containing |
23 * a non-empty name and a value separated by a '=' character. | 22 * a non-empty name and a value separated by a '=' character. |
24 * The name does not contain a '=' character, | 23 * The name does not contain a '=' character, |
(...skipping 14 matching lines...) Expand all Loading... |
39 static String packageRoot = _packageRoot(); | 38 static String packageRoot = _packageRoot(); |
40 static String packageConfig = _packageConfig(); | 39 static String packageConfig = _packageConfig(); |
41 | 40 |
42 // Cache the OS environment. This can be an OSError instance if | 41 // Cache the OS environment. This can be an OSError instance if |
43 // retrieving the environment failed. | 42 // retrieving the environment failed. |
44 static var /*OSError|Map<String,String>*/ _environmentCache; | 43 static var /*OSError|Map<String,String>*/ _environmentCache; |
45 | 44 |
46 static int get numberOfProcessors => _numberOfProcessors(); | 45 static int get numberOfProcessors => _numberOfProcessors(); |
47 static String get pathSeparator => _pathSeparator(); | 46 static String get pathSeparator => _pathSeparator(); |
48 static String get operatingSystem => _operatingSystem(); | 47 static String get operatingSystem => _operatingSystem(); |
49 static bool get ansiSupported => _ansiSupported(); | |
50 static Uri script; | 48 static Uri script; |
51 | 49 |
52 static String get localHostname { | 50 static String get localHostname { |
53 var result = _localHostname(); | 51 var result = _localHostname(); |
54 if (result is OSError) { | 52 if (result is OSError) { |
55 throw result; | 53 throw result; |
56 } else { | 54 } else { |
57 return result; | 55 return result; |
58 } | 56 } |
59 } | 57 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 _map.forEach(f); | 127 _map.forEach(f); |
130 } | 128 } |
131 | 129 |
132 Iterable<String> get keys => _map.keys; | 130 Iterable<String> get keys => _map.keys; |
133 Iterable<V> get values => _map.values; | 131 Iterable<V> get values => _map.values; |
134 int get length => _map.length; | 132 int get length => _map.length; |
135 bool get isEmpty => _map.isEmpty; | 133 bool get isEmpty => _map.isEmpty; |
136 bool get isNotEmpty => _map.isNotEmpty; | 134 bool get isNotEmpty => _map.isNotEmpty; |
137 String toString() => _map.toString(); | 135 String toString() => _map.toString(); |
138 } | 136 } |
OLD | NEW |