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

Unified Diff: packages/path/lib/src/internal_style.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/path/lib/src/context.dart ('k') | packages/path/lib/src/parsed_path.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/path/lib/src/internal_style.dart
diff --git a/packages/path/lib/src/internal_style.dart b/packages/path/lib/src/internal_style.dart
index 549f95ba94b0b79cc4c6cd59b597bd7ba72529a9..21897d6ec9b7423a512557c90ad25f021f710baa 100644
--- a/packages/path/lib/src/internal_style.dart
+++ b/packages/path/lib/src/internal_style.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library path.internal_style;
-
import 'context.dart';
import 'style.dart';
@@ -35,10 +33,11 @@ abstract class InternalStyle extends Style {
/// Returns the number of characters of the root part.
///
- /// Returns 0 if the path is relative.
+ /// Returns 0 if the path is relative and 1 if the path is root-relative.
///
- /// If the path is root-relative, the root length is 1.
- int rootLength(String path);
+ /// If [withDrive] is `true`, this should include the drive letter for `file:`
+ /// URLs. Non-URL styles may ignore the parameter.
+ int rootLength(String path, {bool withDrive: false});
/// Gets the root prefix of [path] if path is absolute. If [path] is relative,
/// returns `null`.
@@ -68,4 +67,18 @@ abstract class InternalStyle extends Style {
/// Returns the URI that represents [path], which is assumed to be absolute.
Uri absolutePathToUri(String path);
+
+ /// Returns whether [codeUnit1] and [codeUnit2] are considered equivalent for
+ /// this style.
+ bool codeUnitsEqual(int codeUnit1, int codeUnit2) => codeUnit1 == codeUnit2;
+
+ /// Returns whether [path1] and [path2] are equivalent.
+ ///
+ /// This only needs to handle character-by-character comparison; it can assume
+ /// the paths are normalized and contain no `..` components.
+ bool pathsEqual(String path1, String path2) => path1 == path2;
+
+ int canonicalizeCodeUnit(int codeUnit) => codeUnit;
+
+ String canonicalizePart(String part) => part;
}
« no previous file with comments | « packages/path/lib/src/context.dart ('k') | packages/path/lib/src/parsed_path.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698