| 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(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * Values are everything after the first '=' character. | 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 external static String _localeName(); | |
| 36 | 35 |
| 37 static String executable = _executable(); | 36 static String executable = _executable(); |
| 38 static String resolvedExecutable = _resolvedExecutable(); | 37 static String resolvedExecutable = _resolvedExecutable(); |
| 39 static String packageRoot = _packageRoot(); | 38 static String packageRoot = _packageRoot(); |
| 40 static String packageConfig = _packageConfig(); | 39 static String packageConfig = _packageConfig(); |
| 41 | 40 |
| 42 static String _cachedLocaleName; | |
| 43 static String get localeName { | |
| 44 if (_cachedLocaleName == null) { | |
| 45 var result = _localeName(); | |
| 46 if (result is OSError) { | |
| 47 throw result; | |
| 48 } | |
| 49 _cachedLocaleName = result; | |
| 50 } | |
| 51 return _cachedLocaleName; | |
| 52 } | |
| 53 | |
| 54 // Cache the OS environment. This can be an OSError instance if | 41 // Cache the OS environment. This can be an OSError instance if |
| 55 // retrieving the environment failed. | 42 // retrieving the environment failed. |
| 56 static var /*OSError|Map<String,String>*/ _environmentCache; | 43 static var /*OSError|Map<String,String>*/ _environmentCache; |
| 57 | 44 |
| 58 static int get numberOfProcessors => _numberOfProcessors(); | 45 static int get numberOfProcessors => _numberOfProcessors(); |
| 59 static String get pathSeparator => _pathSeparator(); | 46 static String get pathSeparator => _pathSeparator(); |
| 60 static String get operatingSystem => _operatingSystem(); | 47 static String get operatingSystem => _operatingSystem(); |
| 61 static Uri script; | 48 static Uri script; |
| 62 | 49 |
| 63 static String get localHostname { | 50 static String get localHostname { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 _map.forEach(f); | 127 _map.forEach(f); |
| 141 } | 128 } |
| 142 | 129 |
| 143 Iterable<String> get keys => _map.keys; | 130 Iterable<String> get keys => _map.keys; |
| 144 Iterable<V> get values => _map.values; | 131 Iterable<V> get values => _map.values; |
| 145 int get length => _map.length; | 132 int get length => _map.length; |
| 146 bool get isEmpty => _map.isEmpty; | 133 bool get isEmpty => _map.isEmpty; |
| 147 bool get isNotEmpty => _map.isNotEmpty; | 134 bool get isNotEmpty => _map.isNotEmpty; |
| 148 String toString() => _map.toString(); | 135 String toString() => _map.toString(); |
| 149 } | 136 } |
| OLD | NEW |