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

Unified Diff: pkg/path/lib/src/style.dart

Issue 304843002: Deprecate publicly-visible properties on Style in path. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/path/lib/src/parsed_path.dart ('k') | pkg/path/lib/src/style/posix.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/path/lib/src/style.dart
diff --git a/pkg/path/lib/src/style.dart b/pkg/path/lib/src/style.dart
index 9da4b43a603a5fd67fdfa5e32a362e11338fc27d..a94ec68ca8abf194221df4abce2d93c3774269f3 100644
--- a/pkg/path/lib/src/style.dart
+++ b/pkg/path/lib/src/style.dart
@@ -51,67 +51,37 @@ abstract class Style {
/// The name of this path style. Will be "posix" or "windows".
String get name;
- /// The path separator for this style. On POSIX, this is `/`. On Windows,
- /// it's `\`.
+ /// A [Context] that uses this style.
+ Context get context => new Context(style: this);
+
+ @Deprecated("Most Style members will be removed in path 2.0.")
String get separator;
- /// The [Pattern] that can be used to match a separator for a path in this
- /// style. Windows allows both "/" and "\" as path separators even though "\"
- /// is the canonical one.
+ @Deprecated("Most Style members will be removed in path 2.0.")
Pattern get separatorPattern;
- /// The [Pattern] that matches path components that need a separator after
- /// them.
- ///
- /// Windows and POSIX styles just need separators when the previous component
- /// doesn't already end in a separator, but the URL always needs to place a
- /// separator between the root and the first component, even if the root
- /// already ends in a separator character. For example, to join "file://" and
- /// "usr", an additional "/" is needed (making "file:///usr").
+ @Deprecated("Most Style members will be removed in path 2.0.")
Pattern get needsSeparatorPattern;
- /// The [Pattern] that can be used to match the root prefix of an absolute
- /// path in this style.
+ @Deprecated("Most Style members will be removed in path 2.0.")
Pattern get rootPattern;
- /// The [Pattern] that can be used to match the root prefix of a root-relative
- /// path in this style.
- ///
- /// This can be null to indicate that this style doesn't support root-relative
- /// paths.
- final Pattern relativeRootPattern = null;
+ @Deprecated("Most Style members will be removed in path 2.0.")
+ Pattern get relativeRootPattern;
- /// A [Context] that uses this style.
- Context get context => new Context(style: this);
-
- /// Gets the root prefix of [path] if path is absolute. If [path] is relative,
- /// returns `null`.
- String getRoot(String path) {
- // TODO(rnystrom): Use firstMatch() when #7080 is fixed.
- var matches = rootPattern.allMatches(path);
- if (matches.isNotEmpty) return matches.first[0];
- return getRelativeRoot(path);
- }
+ @Deprecated("Most style members will be removed in path 2.0.")
+ String getRoot(String path);
- /// Gets the root prefix of [path] if it's root-relative.
- ///
- /// If [path] is relative or absolute and not root-relative, returns `null`.
- String getRelativeRoot(String path) {
- if (relativeRootPattern == null) return null;
- // TODO(rnystrom): Use firstMatch() when #7080 is fixed.
- var matches = relativeRootPattern.allMatches(path);
- if (matches.isEmpty) return null;
- return matches.first[0];
- }
+ @Deprecated("Most style members will be removed in path 2.0.")
+ String getRelativeRoot(String path);
- /// Returns the path represented by [uri] in this style.
+ @Deprecated("Most style members will be removed in path 2.0.")
String pathFromUri(Uri uri);
- /// Returns the URI that represents the relative path made of [parts].
- Uri relativePathToUri(String path) =>
- new Uri(pathSegments: context.split(path));
+ @Deprecated("Most style members will be removed in path 2.0.")
+ Uri relativePathToUri(String path);
- /// Returns the URI that represents [path], which is assumed to be absolute.
+ @Deprecated("Most style members will be removed in path 2.0.")
Uri absolutePathToUri(String path);
String toString() => name;
« no previous file with comments | « pkg/path/lib/src/parsed_path.dart ('k') | pkg/path/lib/src/style/posix.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698