| 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 * A Path is an immutable wrapper of a String, with additional member functions | 8 * A Path is an immutable wrapper of a String, with additional member functions |
| 9 * for useful path manipulations and queries. | 9 * for useful path manipulations and queries. |
| 10 * On the Windows platform, Path also converts from native paths to paths using | 10 * On the Windows platform, Path also converts from native paths to paths using |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 * | 121 * |
| 122 * To compute a relative path using URL semantics, where the final | 122 * To compute a relative path using URL semantics, where the final |
| 123 * path component of the base is dropped unless it ends with a slash, | 123 * path component of the base is dropped unless it ends with a slash, |
| 124 * call [: a.relativeTo(b.directoryPath) :] instead of [: a.relativeTo(b) :]. | 124 * call [: a.relativeTo(b.directoryPath) :] instead of [: a.relativeTo(b) :]. |
| 125 */ | 125 */ |
| 126 Path relativeTo(Path base); | 126 Path relativeTo(Path base); |
| 127 | 127 |
| 128 /** | 128 /** |
| 129 * Converts a path to a string using the native filesystem's conventions. | 129 * Converts a path to a string using the native filesystem's conventions. |
| 130 * | 130 * |
| 131 * Always returns '.' if the path is empty. |
| 131 * On Windows, converts '/'s to backwards slashes, and removes | 132 * On Windows, converts '/'s to backwards slashes, and removes |
| 132 * the leading '/' if the path starts with a drive specification. | 133 * the leading '/' if the path starts with a drive specification. |
| 133 * For most valid Windows paths, this should be the inverse of the | 134 * For most valid Windows paths, this should be the inverse of the |
| 134 * conversion that the constructor new Path() performs. If the path is | 135 * conversion that the constructor new Path() performs. If the path is |
| 135 * a Windows share, restores the '\\' at the start of the path. | 136 * a Windows share, restores the '\\' at the start of the path. |
| 136 */ | 137 */ |
| 137 String toNativePath(); | 138 String toNativePath(); |
| 138 | 139 |
| 139 /** | 140 /** |
| 140 * Returns the path as a string. If this path is constructed using | 141 * Returns the path as a string. If this path is constructed using |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 199 |
| 199 /** | 200 /** |
| 200 * The part of [filename] after the last '.', or '' if [filename] | 201 * The part of [filename] after the last '.', or '' if [filename] |
| 201 * contains no '.'. If [filename] is '.' or '..', returns ''. | 202 * contains no '.'. If [filename] is '.' or '..', returns ''. |
| 202 * | 203 * |
| 203 * new Path('tiger.svg').extension == 'svg' | 204 * new Path('tiger.svg').extension == 'svg' |
| 204 * new Path('/src/dart/dart_secrets').extension == '' | 205 * new Path('/src/dart/dart_secrets').extension == '' |
| 205 */ | 206 */ |
| 206 String get extension; | 207 String get extension; |
| 207 } | 208 } |
| OLD | NEW |