44
55/// A comprehensive, cross-platform path manipulation library.
66///
7- /// ## Installing ##
8- ///
9- /// Use [pub][] to install this package. Add the following to your
10- /// `pubspec.yaml` file.
11- ///
12- /// dependencies:
13- /// path: any
14- ///
15- /// Then run `pub install` .
16- ///
17- /// For more information, see the [path package on pub.dartlang.org][pkg] .
18- ///
19- /// [pub] : http://pub.dartlang.org
20- /// [pkg] : http://pub.dartlang.org/packages/path
21- ///
22- /// ## Usage ##
23- ///
247/// The path library was designed to be imported with a prefix, though you don't
258/// have to if you don't want to:
269///
3013/// These manipulate path strings based on your current working directory and
3114/// the path style (POSIX, Windows, or URLs) of the host platform. For example:
3215///
33- /// p.join(" directory", " file.txt" );
16+ /// p.join(' directory', ' file.txt' );
3417///
3518/// This calls the top-level [join] function to join "directory" and "file.txt"
3619/// using the current platform's directory separator.
3922/// underlying platform that the program is running on, you can create a
4023/// [Context] and give it an explicit [Style] :
4124///
42- /// var context = new p.Context(style: Style.windows);
43- /// context.join(" directory", " file.txt" );
25+ /// var context = p.Context(style: Style.windows);
26+ /// context.join(' directory', ' file.txt' );
4427///
4528/// This will join "directory" and "file.txt" using the Windows path separator,
4629/// even when the program is run on a POSIX machine.
@@ -221,8 +204,8 @@ String extension(String path, [int level = 1]) =>
221204///
222205/// // URL
223206/// p.rootPrefix('path/to/foo'); // -> ''
224- /// p.rootPrefix('http ://dartlang.org /path/to/foo');
225- /// // -> 'http ://dartlang.org '
207+ /// p.rootPrefix('https ://dart.dev /path/to/foo');
208+ /// // -> 'https ://dart.dev '
226209String rootPrefix (String path) => context.rootPrefix (path);
227210
228211/// Returns `true` if [path] is an absolute path and `false` if it is a
@@ -231,7 +214,7 @@ String rootPrefix(String path) => context.rootPrefix(path);
231214/// On POSIX systems, absolute paths start with a `/` (forward slash). On
232215/// Windows, an absolute path starts with `\\` , or a drive letter followed by
233216/// `:/` or `:\` . For URLs, absolute paths either start with a protocol and
234- /// optional hostname (e.g. `http ://dartlang.org ` , `file://` ) or with a `/` .
217+ /// optional hostname (e.g. `https ://dart.dev ` , `file://` ) or with a `/` .
235218///
236219/// URLs that start with `/` are known as "root-relative", since they're
237220/// relative to the root of the current URL. Since root-relative paths are still
@@ -315,8 +298,8 @@ String joinAll(Iterable<String> parts) => context.joinAll(parts);
315298/// // -> [r'\\server\share', 'foo', 'bar', 'baz']
316299///
317300/// // Browser
318- /// p.split('http ://dartlang.org /path/to/foo');
319- /// // -> ['http ://dartlang.org ', 'path', 'to', 'foo']
301+ /// p.split('https ://dart.dev /path/to/foo');
302+ /// // -> ['https ://dart.dev ', 'path', 'to', 'foo']
320303List <String > split (String path) => context.split (path);
321304
322305/// Canonicalizes [path] .
@@ -367,8 +350,8 @@ String normalize(String path) => context.normalize(path);
367350/// p.relative(r'D:\other', from: r'C:\home'); // -> 'D:\other'
368351///
369352/// // URL
370- /// p.relative('http ://dartlang.org ', from: 'http ://pub.dartlang.org ');
371- /// // -> 'http ://dartlang.org '
353+ /// p.relative('https ://dart.dev ', from: 'https ://pub.dev ');
354+ /// // -> 'https ://dart.dev '
372355String relative (String path, {String from}) =>
373356 context.relative (path, from: from);
374357
@@ -422,8 +405,8 @@ String setExtension(String path, String extension) =>
422405/// p.fromUri('file:///C:/path/to/foo') // -> r'C:\path\to\foo'
423406///
424407/// // URL
425- /// p.fromUri('http ://dartlang.org /path/to/foo')
426- /// // -> 'http ://dartlang.org /path/to/foo'
408+ /// p.fromUri('https ://dart.dev /path/to/foo')
409+ /// // -> 'https ://dart.dev /path/to/foo'
427410///
428411/// If [uri] is relative, a relative path will be returned.
429412///
@@ -444,8 +427,8 @@ String fromUri(uri) => context.fromUri(uri);
444427/// // -> Uri.parse('file:///C:/path/to/foo')
445428///
446429/// // URL
447- /// p.toUri('http ://dartlang.org /path/to/foo')
448- /// // -> Uri.parse('http ://dartlang.org /path/to/foo')
430+ /// p.toUri('https ://dart.dev /path/to/foo')
431+ /// // -> Uri.parse('https ://dart.dev /path/to/foo')
449432///
450433/// If [path] is relative, a relative URI will be returned.
451434///
@@ -463,13 +446,13 @@ Uri toUri(String path) => context.toUri(path);
463446///
464447/// // POSIX at "/root/path"
465448/// p.prettyUri('file:///root/path/a/b.dart'); // -> 'a/b.dart'
466- /// p.prettyUri('http ://dartlang.org /'); // -> 'http ://dartlang.org '
449+ /// p.prettyUri('https ://dart.dev /'); // -> 'https ://dart.dev '
467450///
468451/// // Windows at "C:\root\path"
469452/// p.prettyUri('file:///C:/root/path/a/b.dart'); // -> r'a\b.dart'
470- /// p.prettyUri('http ://dartlang.org /'); // -> 'http ://dartlang.org '
453+ /// p.prettyUri('https ://dart.dev /'); // -> 'https ://dart.dev '
471454///
472- /// // URL at "http ://dartlang.org /root/path"
473- /// p.prettyUri('http ://dartlang.org /root/path/a/b.dart'); // -> r'a/b.dart'
455+ /// // URL at "https ://dart.dev /root/path"
456+ /// p.prettyUri('https ://dart.dev /root/path/a/b.dart'); // -> r'a/b.dart'
474457/// p.prettyUri('file:///root/path'); // -> 'file:///root/path'
475458String prettyUri (uri) => context.prettyUri (uri);
0 commit comments