Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: pkg/path/README.md

Issue 19231002: Port dart:io Path tests to package:path. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix Windows failures Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/path/lib/path.dart » ('j') | pkg/path/test/posix_test.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 A comprehensive, cross-platform path manipulation library for Dart. 1 A comprehensive, cross-platform path manipulation library for Dart.
2 2
3 The path package provides common operations for manipulating file paths: 3 The path package provides common operations for manipulating file paths:
4 joining, splitting, normalizing, etc. 4 joining, splitting, normalizing, etc.
5 5
6 We've tried very hard to make this library do the "right" thing on whatever 6 We've tried very hard to make this library do the "right" thing on whatever
7 platform you run it on. When you use the top-level functions, it will assume the 7 platform you run it on. When you use the top-level functions, it will assume the
8 current platform's path style and work with that. If you want to specifically 8 current platform's path style and work with that. If you want to specifically
9 work with paths of a specific style, you can construct a `path.Builder` for that 9 work with paths of a specific style, you can construct a `path.Builder` for that
10 style. 10 style.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 Gets the part of [path] before the last separator. 67 Gets the part of [path] before the last separator.
68 68
69 path.dirname('path/to/foo.dart'); // -> 'path/to' 69 path.dirname('path/to/foo.dart'); // -> 'path/to'
70 path.dirname('path/to'); // -> 'to' 70 path.dirname('path/to'); // -> 'to'
71 71
72 Trailing separators are ignored. 72 Trailing separators are ignored.
73 73
74 builder.dirname('path/to/'); // -> 'path' 74 builder.dirname('path/to/'); // -> 'path'
75 75
76 If an absolute path contains no directories, only a root, then the root
77 is returned.
78
79 path.dirname('/'); // -> '/' (posix)
80 path.dirname('c:\'); // -> 'c:\' (windows)
81
82 If a relative path has no directories, then '.' is returned.
83 path.dirname('foo'); // -> '.'
84 path.dirname(''); // -> '.'
85
76 ### String extension(String path) 86 ### String extension(String path)
77 87
78 Gets the file extension of [path]: the portion of [basename] from the last 88 Gets the file extension of [path]: the portion of [basename] from the last
79 `.` to the end (including the `.` itself). 89 `.` to the end (including the `.` itself).
80 90
81 path.extension('path/to/foo.dart'); // -> '.dart' 91 path.extension('path/to/foo.dart'); // -> '.dart'
82 path.extension('path/to/foo'); // -> '' 92 path.extension('path/to/foo'); // -> ''
83 path.extension('path.to/foo'); // -> '' 93 path.extension('path.to/foo'); // -> ''
84 path.extension('path/to/foo.dart.js'); // -> '.js' 94 path.extension('path/to/foo.dart.js'); // -> '.js'
85 95
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 * It can accurately tell if a path is absolute based on drive-letters or UNC 394 * It can accurately tell if a path is absolute based on drive-letters or UNC
385 prefix. 395 prefix.
386 396
387 * It understands that "/foo" is not an absolute path on Windows. 397 * It understands that "/foo" is not an absolute path on Windows.
388 398
389 * It knows that "C:\foo\one.txt" and "c:/foo\two.txt" are two files in the 399 * It knows that "C:\foo\one.txt" and "c:/foo\two.txt" are two files in the
390 same directory. 400 same directory.
391 401
392 If you find a problem, surprise or something that's unclear, please don't 402 If you find a problem, surprise or something that's unclear, please don't
393 hesitate to [file a bug](http://dartbug.com/new) and let us know. 403 hesitate to [file a bug](http://dartbug.com/new) and let us know.
OLDNEW
« no previous file with comments | « no previous file | pkg/path/lib/path.dart » ('j') | pkg/path/test/posix_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698