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

Side by Side Diff: pkg/path/lib/src/parsed_path.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, 6 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/lib/src/internal_style.dart ('k') | pkg/path/lib/src/style.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library path.parsed_path; 5 library path.parsed_path;
6 6
7 import 'internal_style.dart';
7 import 'style.dart'; 8 import 'style.dart';
8 9
9 // TODO(rnystrom): Make this public?
10 class ParsedPath { 10 class ParsedPath {
11 /// The [Style] that was used to parse this path. 11 /// The [InternalStyle] that was used to parse this path.
12 Style style; 12 InternalStyle style;
13 13
14 /// The absolute root portion of the path, or `null` if the path is relative. 14 /// The absolute root portion of the path, or `null` if the path is relative.
15 /// On POSIX systems, this will be `null` or "/". On Windows, it can be 15 /// On POSIX systems, this will be `null` or "/". On Windows, it can be
16 /// `null`, "//" for a UNC path, or something like "C:\" for paths with drive 16 /// `null`, "//" for a UNC path, or something like "C:\" for paths with drive
17 /// letters. 17 /// letters.
18 String root; 18 String root;
19 19
20 /// Whether this path is root-relative. 20 /// Whether this path is root-relative.
21 /// 21 ///
22 /// See [Context.isRootRelative]. 22 /// See [Context.isRootRelative].
(...skipping 10 matching lines...) Expand all
33 /// path ends with a trailing separator. 33 /// path ends with a trailing separator.
34 List<String> separators; 34 List<String> separators;
35 35
36 /// The file extension of the last non-empty part, or "" if it doesn't have 36 /// The file extension of the last non-empty part, or "" if it doesn't have
37 /// one. 37 /// one.
38 String get extension => _splitExtension()[1]; 38 String get extension => _splitExtension()[1];
39 39
40 /// `true` if this is an absolute path. 40 /// `true` if this is an absolute path.
41 bool get isAbsolute => root != null; 41 bool get isAbsolute => root != null;
42 42
43 factory ParsedPath.parse(String path, Style style) { 43 factory ParsedPath.parse(String path, InternalStyle style) {
44 var before = path; 44 var before = path;
45 45
46 // Remove the root prefix, if any. 46 // Remove the root prefix, if any.
47 var root = style.getRoot(path); 47 var root = style.getRoot(path);
48 var isRootRelative = style.getRelativeRoot(path) != null; 48 var isRootRelative = style.getRelativeRoot(path) != null;
49 if (root != null) path = path.substring(root.length); 49 if (root != null) path = path.substring(root.length);
50 50
51 // Split the parts on path separators. 51 // Split the parts on path separators.
52 var parts = []; 52 var parts = [];
53 var separators = []; 53 var separators = [];
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 if (lastDot <= 0) return [file, '']; 177 if (lastDot <= 0) return [file, ''];
178 178
179 return [file.substring(0, lastDot), file.substring(lastDot)]; 179 return [file.substring(0, lastDot), file.substring(lastDot)];
180 } 180 }
181 181
182 ParsedPath clone() => new ParsedPath._( 182 ParsedPath clone() => new ParsedPath._(
183 style, root, isRootRelative, 183 style, root, isRootRelative,
184 new List.from(parts), new List.from(separators)); 184 new List.from(parts), new List.from(separators));
185 } 185 }
186 186
OLDNEW
« no previous file with comments | « pkg/path/lib/src/internal_style.dart ('k') | pkg/path/lib/src/style.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698