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

Side by Side Diff: observatory_pub_packages/path/src/internal_style.dart

Issue 816693004: Add observatory_pub_packages snapshot to third_party (Closed) Base URL: http://dart.googlecode.com/svn/third_party/
Patch Set: Created 6 years 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
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
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.
4
5 library path.internal_style;
6
7 import 'context.dart';
8 import 'style.dart';
9
10 /// The internal interface for the [Style] type.
11 ///
12 /// Users should be able to pass around instances of [Style] like an enum, but
13 /// the members that [Context] uses should be hidden from them. Those members
14 /// are defined on this class instead.
15 abstract class InternalStyle extends Style {
16 /// The default path separator for this style.
17 ///
18 /// On POSIX, this is `/`. On Windows, it's `\`.
19 String get separator;
20
21 /// Returns whether [path] contains a separator.
22 bool containsSeparator(String path);
23
24 /// Returns whether [codeUnit] is the character code of a separator.
25 bool isSeparator(int codeUnit);
26
27 /// Returns whether this path component needs a separator after it.
28 ///
29 /// Windows and POSIX styles just need separators when the previous component
30 /// doesn't already end in a separator, but the URL always needs to place a
31 /// separator between the root and the first component, even if the root
32 /// already ends in a separator character. For example, to join "file://" and
33 /// "usr", an additional "/" is needed (making "file:///usr").
34 bool needsSeparator(String path);
35
36 /// Gets the root prefix of [path] if path is absolute. If [path] is relative,
37 /// returns `null`.
38 String getRoot(String path);
39
40 /// Gets the root prefix of [path] if it's root-relative.
41 ///
42 /// If [path] is relative or absolute and not root-relative, returns `null`.
43 String getRelativeRoot(String path);
44
45 /// Returns the path represented by [uri] in this style.
46 String pathFromUri(Uri uri);
47
48 /// Returns the URI that represents the relative path made of [parts].
49 Uri relativePathToUri(String path) =>
50 new Uri(pathSegments: context.split(path));
51
52 /// Returns the URI that represents [path], which is assumed to be absolute.
53 Uri absolutePathToUri(String path);
54 }
OLDNEW
« no previous file with comments | « observatory_pub_packages/path/src/context.dart ('k') | observatory_pub_packages/path/src/parsed_path.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698