| 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 | 14 |
| 15 /** | 15 /** |
| 16 * Retrieve the entries of the process environment. | 16 * Retrieve the entries of the process environment. |
| 17 * | 17 * |
| 18 * The result is an [Iterable] of strings, where each string represents | 18 * The result is an [Iterable] of strings, where each string represents |
| 19 * an environment entry. | 19 * an environment entry. |
| 20 * | 20 * |
| 21 * Environment entries should be strings containing | 21 * Environment entries should be strings containing |
| 22 * a non-empty name and a value separated by a '=' character. | 22 * a non-empty name and a value separated by a '=' character. |
| 23 * The name does not contain a '=' character, | 23 * The name does not contain a '=' character, |
| 24 * so the name is everything up to the first '=' character. | 24 * so the name is everything up to the first '=' character. |
| 25 * Values are everything after the first '=' charcacter. | 25 * Values are everything after the first '=' character. |
| 26 * A value may contain further '=' characters, and it may be empty. | 26 * A value may contain further '=' characters, and it may be empty. |
| 27 * | 27 * |
| 28 * Returns an [OSError] if retrieving the environment fails. | 28 * Returns an [OSError] if retrieving the environment fails. |
| 29 */ | 29 */ |
| 30 external static _environment(); | 30 external static _environment(); |
| 31 external static List<String> _executableArguments(); | 31 external static List<String> _executableArguments(); |
| 32 external static String _packageRoot(); | 32 external static String _packageRoot(); |
| 33 external static String _packageConfig(); | 33 external static String _packageConfig(); |
| 34 external static String _version(); | 34 external static String _version(); |
| 35 | 35 |
| 36 static String executable = _executable(); | 36 static String executable = _executable(); |
| 37 static String resolvedExecutable = _resolvedExecutable(); | 37 static String resolvedExecutable = _resolvedExecutable(); |
| 38 static String packageRoot = _packageRoot(); | 38 static String packageRoot = _packageRoot(); |
| 39 static String packageConfig = _packageConfig(); | 39 static String packageConfig = _packageConfig(); |
| 40 | 40 |
| 41 // Cache the OS environemnt. This can be an OSError instance if | 41 // Cache the OS environment. This can be an OSError instance if |
| 42 // retrieving the environment failed. | 42 // retrieving the environment failed. |
| 43 static var/*OSError|Map<String,String>*/ _environmentCache; | 43 static var/*OSError|Map<String,String>*/ _environmentCache; |
| 44 | 44 |
| 45 static int get numberOfProcessors => _numberOfProcessors(); | 45 static int get numberOfProcessors => _numberOfProcessors(); |
| 46 static String get pathSeparator => _pathSeparator(); | 46 static String get pathSeparator => _pathSeparator(); |
| 47 static String get operatingSystem => _operatingSystem(); | 47 static String get operatingSystem => _operatingSystem(); |
| 48 static Uri script; | 48 static Uri script; |
| 49 | 49 |
| 50 static String get localHostname { | 50 static String get localHostname { |
| 51 var result = _localHostname(); | 51 var result = _localHostname(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 V remove(Object key) => key is String ? _map.remove(key.toUpperCase()) : null; | 118 V remove(Object key) => key is String ? _map.remove(key.toUpperCase()) : null; |
| 119 void clear() { _map.clear(); } | 119 void clear() { _map.clear(); } |
| 120 void forEach(void f(String key, V value)) { _map.forEach(f); } | 120 void forEach(void f(String key, V value)) { _map.forEach(f); } |
| 121 Iterable<String> get keys => _map.keys; | 121 Iterable<String> get keys => _map.keys; |
| 122 Iterable<V> get values => _map.values; | 122 Iterable<V> get values => _map.values; |
| 123 int get length => _map.length; | 123 int get length => _map.length; |
| 124 bool get isEmpty => _map.isEmpty; | 124 bool get isEmpty => _map.isEmpty; |
| 125 bool get isNotEmpty => _map.isNotEmpty; | 125 bool get isNotEmpty => _map.isNotEmpty; |
| 126 String toString() => _map.toString(); | 126 String toString() => _map.toString(); |
| 127 } | 127 } |
| OLD | NEW |