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; |
| 6 |
5 class _Path implements Path { | 7 class _Path implements Path { |
6 final String _path; | 8 final String _path; |
7 final bool isWindowsShare; | 9 final bool isWindowsShare; |
8 | 10 |
9 _Path(String source) : _path = source, isWindowsShare = false; | 11 _Path(String source) : _path = source, isWindowsShare = false; |
10 | 12 |
11 _Path.fromNative(String source) | 13 _Path.fromNative(String source) |
12 : _path = _clean(source), isWindowsShare = _isWindowsShare(source); | 14 : _path = _clean(source), isWindowsShare = _isWindowsShare(source); |
13 | 15 |
14 _Path._internal(String this._path, bool this.isWindowsShare); | 16 _Path._internal(String this._path, bool this.isWindowsShare); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 while (pos > 0 && _path[pos - 1] == '/') --pos; | 253 while (pos > 0 && _path[pos - 1] == '/') --pos; |
252 var dirPath = (pos > 0) ? _path.substring(0, pos) : '/'; | 254 var dirPath = (pos > 0) ? _path.substring(0, pos) : '/'; |
253 return new _Path._internal(dirPath, isWindowsShare); | 255 return new _Path._internal(dirPath, isWindowsShare); |
254 } | 256 } |
255 | 257 |
256 String get filename { | 258 String get filename { |
257 int pos = _path.lastIndexOf('/'); | 259 int pos = _path.lastIndexOf('/'); |
258 return _path.substring(pos + 1); | 260 return _path.substring(pos + 1); |
259 } | 261 } |
260 } | 262 } |
OLD | NEW |