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 /** | 7 /** |
8 * Information about the environment in which the current program is running. | 8 * Information about the environment in which the current program is running. |
9 * | 9 * |
10 * Platform provides information such as the operating system, | 10 * Platform provides information such as the operating system, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 * provides additional task-oriented code samples that show how to use | 65 * provides additional task-oriented code samples that show how to use |
66 * various API from the [dart:io] library. | 66 * various API from the [dart:io] library. |
67 */ | 67 */ |
68 class Platform { | 68 class Platform { |
69 static final _numberOfProcessors = _Platform.numberOfProcessors; | 69 static final _numberOfProcessors = _Platform.numberOfProcessors; |
70 static final _pathSeparator = _Platform.pathSeparator; | 70 static final _pathSeparator = _Platform.pathSeparator; |
71 static final _operatingSystem = _Platform.operatingSystem; | 71 static final _operatingSystem = _Platform.operatingSystem; |
72 static final _localHostname = _Platform.localHostname; | 72 static final _localHostname = _Platform.localHostname; |
73 static final _version = _Platform.version; | 73 static final _version = _Platform.version; |
74 | 74 |
75 // This script singleton is written to by the embedder if applicable. | |
76 static String _nativeScript = ''; | |
77 | |
78 /** | 75 /** |
79 * Get the number of processors of the machine. | 76 * Get the number of processors of the machine. |
80 */ | 77 */ |
81 static int get numberOfProcessors => _numberOfProcessors; | 78 static int get numberOfProcessors => _numberOfProcessors; |
82 | 79 |
83 /** | 80 /** |
84 * Get the path separator used by the operating system to separate | 81 * Get the path separator used by the operating system to separate |
85 * components in file paths. | 82 * components in file paths. |
86 */ | 83 */ |
87 static String get pathSeparator => _pathSeparator; | 84 static String get pathSeparator => _pathSeparator; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 * | 169 * |
173 * If there is no --package-root flag, then the empty string is returned. | 170 * If there is no --package-root flag, then the empty string is returned. |
174 */ | 171 */ |
175 static String get packageRoot => _Platform.packageRoot; | 172 static String get packageRoot => _Platform.packageRoot; |
176 | 173 |
177 /** | 174 /** |
178 * Returns the version of the current Dart runtime. | 175 * Returns the version of the current Dart runtime. |
179 */ | 176 */ |
180 static String get version => _version; | 177 static String get version => _version; |
181 } | 178 } |
OLD | NEW |