Index: sdk/lib/io/path.dart |
diff --git a/sdk/lib/io/path.dart b/sdk/lib/io/path.dart |
index 82a73023045a8156e5621d200f5550168b7f1277..b1bd48c3353b1095d7d6363c74fbfff8516b3402 100644 |
--- a/sdk/lib/io/path.dart |
+++ b/sdk/lib/io/path.dart |
@@ -13,21 +13,15 @@ part of dart.io; |
*/ |
abstract class Path { |
/** |
- * Creates a Path from the String [source]. [source] is used as-is, so if |
- * the string does not consist of segments separated by forward slashes, the |
- * behavior may not be as expected. Paths are immutable. |
- */ |
- factory Path(String source) => new _Path(source); |
- |
- /** |
* Creates a Path from a String that uses the native filesystem's conventions. |
* |
* On Windows, this converts '\' to '/' and has special handling for drive |
* letters and shares. |
* |
- * If the path contains a drive letter a '/' is added before the drive letter. |
+ * If the path starts with a drive letter, like 'C:', a '/' is added |
+ * before the drive letter. |
* |
- * new Path.fromNative(r'c:\a\b').toString() == '/c:/a/b' |
+ * new Path(r'c:\a\b').toString() == '/c:/a/b' |
* |
* A path starting with '/c:/' (or any other character instead of 'c') is |
* treated specially. Backwards links ('..') cannot cancel the drive letter. |
@@ -35,15 +29,29 @@ abstract class Path { |
* If the path is a share path this is recorded in the Path object and |
* maintained in operations on the Path object. |
* |
- * var share = new Path.fromNative(r'\\share\a\b\c'); |
+ * var share = new Path(r'\\share\a\b\c'); |
* share.isWindowsShare == true |
* share.toString() == '/share/a/b/c' |
* share.toNativePath() == r'\\share\a\b\c' |
* share.append('final').isWindowsShare == true |
*/ |
+ factory Path(String source) => new _Path(source); |
+ |
+ // TODO(whesse): Remove this constructor, and change its uses to the default. |
Mads Ager (google)
2013/01/14 12:33:34
I would be in favor of just removing it as part of
|
+ /** |
+ * Legacy method - this functionality has been moved to the default |
+ * constructor. Will be removed in a subsequent changelist. |
+ */ |
factory Path.fromNative(String source) => new _Path.fromNative(source); |
/** |
+ * Creates a Path from the String [source]. [source] is used as-is, so if |
+ * the string does not consist of segments separated by forward slashes, the |
+ * behavior may not be as expected. Paths are immutable. |
Mads Ager (google)
2013/01/14 12:33:34
"Paths are immutable." seems like a class comment
|
+ */ |
+ factory Path.raw(String source) => new _Path.raw(source); |
+ |
+ /** |
* Is this path the empty string? |
*/ |
bool get isEmpty; |