| 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(); |
| 14 | 15 |
| 15 /** | 16 /** |
| 16 * Retrieve the entries of the process environment. | 17 * Retrieve the entries of the process environment. |
| 17 * | 18 * |
| 18 * The result is an [Iterable] of strings, where each string represents | 19 * The result is an [Iterable] of strings, where each string represents |
| 19 * an environment entry. | 20 * an environment entry. |
| 20 * | 21 * |
| 21 * Environment entries should be strings containing | 22 * Environment entries should be strings containing |
| 22 * a non-empty name and a value separated by a '=' character. | 23 * a non-empty name and a value separated by a '=' character. |
| 23 * The name does not contain a '=' character, | 24 * The name does not contain a '=' character, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 38 static String packageRoot = _packageRoot(); | 39 static String packageRoot = _packageRoot(); |
| 39 static String packageConfig = _packageConfig(); | 40 static String packageConfig = _packageConfig(); |
| 40 | 41 |
| 41 // Cache the OS environment. This can be an OSError instance if | 42 // Cache the OS environment. This can be an OSError instance if |
| 42 // retrieving the environment failed. | 43 // retrieving the environment failed. |
| 43 static var/*OSError|Map<String,String>*/ _environmentCache; | 44 static var/*OSError|Map<String,String>*/ _environmentCache; |
| 44 | 45 |
| 45 static int get numberOfProcessors => _numberOfProcessors(); | 46 static int get numberOfProcessors => _numberOfProcessors(); |
| 46 static String get pathSeparator => _pathSeparator(); | 47 static String get pathSeparator => _pathSeparator(); |
| 47 static String get operatingSystem => _operatingSystem(); | 48 static String get operatingSystem => _operatingSystem(); |
| 49 static bool get ansiSupported => _ansiSupported(); |
| 48 static Uri script; | 50 static Uri script; |
| 49 | 51 |
| 50 static String get localHostname { | 52 static String get localHostname { |
| 51 var result = _localHostname(); | 53 var result = _localHostname(); |
| 52 if (result is OSError) { | 54 if (result is OSError) { |
| 53 throw result; | 55 throw result; |
| 54 } else { | 56 } else { |
| 55 return result; | 57 return result; |
| 56 } | 58 } |
| 57 } | 59 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 V remove(Object key) => key is String ? _map.remove(key.toUpperCase()) : null; | 120 V remove(Object key) => key is String ? _map.remove(key.toUpperCase()) : null; |
| 119 void clear() { _map.clear(); } | 121 void clear() { _map.clear(); } |
| 120 void forEach(void f(String key, V value)) { _map.forEach(f); } | 122 void forEach(void f(String key, V value)) { _map.forEach(f); } |
| 121 Iterable<String> get keys => _map.keys; | 123 Iterable<String> get keys => _map.keys; |
| 122 Iterable<V> get values => _map.values; | 124 Iterable<V> get values => _map.values; |
| 123 int get length => _map.length; | 125 int get length => _map.length; |
| 124 bool get isEmpty => _map.isEmpty; | 126 bool get isEmpty => _map.isEmpty; |
| 125 bool get isNotEmpty => _map.isNotEmpty; | 127 bool get isNotEmpty => _map.isNotEmpty; |
| 126 String toString() => _map.toString(); | 128 String toString() => _map.toString(); |
| 127 } | 129 } |
| OLD | NEW |