| 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 library legacy_path; | 5 library test_dart_copy.legacy_path; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'dart:math'; | 8 import 'dart:math'; |
| 9 | 9 |
| 10 // TODO: Remove this class, and use the URI class for all path manipulation. | 10 // TODO: Remove this class, and use the URI class for all path manipulation. |
| 11 class Path { | 11 class Path { |
| 12 final String _path; | 12 final String _path; |
| 13 final bool isWindowsShare; | 13 final bool isWindowsShare; |
| 14 | 14 |
| 15 Path(String source) | 15 Path(String source) |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 while (pos > 0 && _path[pos - 1] == '/') --pos; | 302 while (pos > 0 && _path[pos - 1] == '/') --pos; |
| 303 var dirPath = (pos > 0) ? _path.substring(0, pos) : '/'; | 303 var dirPath = (pos > 0) ? _path.substring(0, pos) : '/'; |
| 304 return new Path._internal(dirPath, isWindowsShare); | 304 return new Path._internal(dirPath, isWindowsShare); |
| 305 } | 305 } |
| 306 | 306 |
| 307 String get filename { | 307 String get filename { |
| 308 int pos = _path.lastIndexOf('/'); | 308 int pos = _path.lastIndexOf('/'); |
| 309 return _path.substring(pos + 1); | 309 return _path.substring(pos + 1); |
| 310 } | 310 } |
| 311 } | 311 } |
| OLD | NEW |