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 @deprecated |
7 /** | 8 /** |
8 * The [Platform] class exposes details of the machine and operating | 9 * Deprecated: the [Platform] class exposes details of the machine and operating |
9 * system. | 10 * system. |
| 11 * |
| 12 * This class has been replaced by adding the dart:platform library to Dart. |
| 13 * dart:platform is available on all browser and standalone platforms, |
| 14 * including Dart code that has been compiled to javascript. |
| 15 * |
| 16 * The dart:platform class has |
| 17 * the same top-level getters as the members of [Platform], except that the |
| 18 * [isWindows], [isLinux], [isAndroid], and [isMacOS] getters |
| 19 * have been removed. On platforms supporting dart:io, the getters of |
| 20 * dart:platform have the same values as the Platform class members, except |
| 21 * that [script] has been changed from a [String] to a file [Uri]. |
| 22 * |
| 23 * The [Platform] class may be removed as early as November 1, 2013. |
10 */ | 24 */ |
11 class Platform { | 25 class Platform { |
12 static final _numberOfProcessors = _Platform.numberOfProcessors; | 26 static final _numberOfProcessors = _Platform.numberOfProcessors; |
13 static final _pathSeparator = _Platform.pathSeparator; | 27 static final _pathSeparator = _Platform.pathSeparator; |
14 static final _operatingSystem = _Platform.operatingSystem; | 28 static final _operatingSystem = _Platform.operatingSystem; |
15 static final _localHostname = _Platform.localHostname; | 29 static final _localHostname = _Platform.localHostname; |
16 static final _version = _Platform.version; | 30 static final _version = _Platform.version; |
17 | 31 |
18 // This script singleton is written to by the embedder if applicable. | 32 // This script singleton is written to by the embedder if applicable. |
19 static String _nativeScript = ''; | 33 static String _nativeScript = ''; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 * | 118 * |
105 * If there is no --package-root flag, then the empty string is returned. | 119 * If there is no --package-root flag, then the empty string is returned. |
106 */ | 120 */ |
107 static String get packageRoot => _Platform.packageRoot; | 121 static String get packageRoot => _Platform.packageRoot; |
108 | 122 |
109 /** | 123 /** |
110 * Returns the version of the current Dart runtime. | 124 * Returns the version of the current Dart runtime. |
111 */ | 125 */ |
112 static String get version => _version; | 126 static String get version => _version; |
113 } | 127 } |
OLD | NEW |