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

Side by Side Diff: pkg/path/lib/path.dart

Issue 296233002: Add a path.formatUri method and release path 1.2.0. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 7 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 | « pkg/path/CHANGELOG.md ('k') | pkg/path/lib/src/context.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /// A comprehensive, cross-platform path manipulation library. 5 /// A comprehensive, cross-platform path manipulation library.
6 /// 6 ///
7 /// ## Installing ## 7 /// ## Installing ##
8 /// 8 ///
9 /// Use [pub][] to install this package. Add the following to your 9 /// Use [pub][] to install this package. Add the following to your
10 /// `pubspec.yaml` file. 10 /// `pubspec.yaml` file.
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 /// 359 ///
360 /// // URL 360 /// // URL
361 /// path.toUri('http://dartlang.org/path/to/foo') 361 /// path.toUri('http://dartlang.org/path/to/foo')
362 /// // -> Uri.parse('http://dartlang.org/path/to/foo') 362 /// // -> Uri.parse('http://dartlang.org/path/to/foo')
363 /// 363 ///
364 /// If [path] is relative, a relative URI will be returned. 364 /// If [path] is relative, a relative URI will be returned.
365 /// 365 ///
366 /// path.toUri('path/to/foo') 366 /// path.toUri('path/to/foo')
367 /// // -> Uri.parse('path/to/foo') 367 /// // -> Uri.parse('path/to/foo')
368 Uri toUri(String path) => _context.toUri(path); 368 Uri toUri(String path) => _context.toUri(path);
369
370 /// Returns a terse, human-readable representation of [uri].
371 ///
372 /// [uri] can be a [String] or a [Uri]. If it can be made relative to the
373 /// current working directory, that's done. Otherwise, it's returned as-is. This
374 /// gracefully handles non-`file:` URIs for [Style.posix] and [Style.windows].
375 ///
376 /// The returned value is meant for human consumption, and may be either URI-
377 /// or path-formatted.
378 ///
379 /// // POSIX at "/root/path"
380 /// path.prettyUri('file:///root/path/a/b.dart'); // -> 'a/b.dart'
381 /// path.prettyUri('http://dartlang.org/'); // -> 'http://dartlang.org'
382 ///
383 /// // Windows at "C:\root\path"
384 /// path.prettyUri('file:///C:/root/path/a/b.dart'); // -> r'a\b.dart'
385 /// path.prettyUri('http://dartlang.org/'); // -> 'http://dartlang.org'
386 ///
387 /// // URL at "http://dartlang.org/root/path"
388 /// path.prettyUri('http://dartlang.org/root/path/a/b.dart');
389 /// // -> r'a/b.dart'
390 /// path.prettyUri('file:///root/path'); // -> 'file:///root/path'
391 String prettyUri(uri) => _context.prettyUri(uri);
OLDNEW
« no previous file with comments | « pkg/path/CHANGELOG.md ('k') | pkg/path/lib/src/context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698