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

Side by Side Diff: sdk/lib/io/path_impl.dart

Issue 12295014: Remove deprecated Strings class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/io/process.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 part of dart.io; 5 part of dart.io;
6 6
7 class _Path implements Path { 7 class _Path implements Path {
8 final String _path; 8 final String _path;
9 final bool isWindowsShare; 9 final bool isWindowsShare;
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 for (int i = common; i < pathSegments.length; i++) { 97 for (int i = common; i < pathSegments.length; i++) {
98 segments.add('${pathSegments[i]}'); 98 segments.add('${pathSegments[i]}');
99 } 99 }
100 if (segments.isEmpty) { 100 if (segments.isEmpty) {
101 segments.add('.'); 101 segments.add('.');
102 } 102 }
103 if (hasTrailingSeparator) { 103 if (hasTrailingSeparator) {
104 segments.add(''); 104 segments.add('');
105 } 105 }
106 return new Path(Strings.join(segments, '/')); 106 return new Path(segments.join('/'));
107 } 107 }
108 108
109 109
110 Path join(Path further) { 110 Path join(Path further) {
111 if (further.isAbsolute) { 111 if (further.isAbsolute) {
112 throw new ArgumentError( 112 throw new ArgumentError(
113 "Path.join called with absolute Path as argument."); 113 "Path.join called with absolute Path as argument.");
114 } 114 }
115 if (isEmpty) { 115 if (isEmpty) {
116 return further.canonicalize(); 116 return further.canonicalize();
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 segmentsToJoin.add(''); 203 segmentsToJoin.add('');
204 } else { 204 } else {
205 segmentsToJoin.add('.'); 205 segmentsToJoin.add('.');
206 } 206 }
207 } else { 207 } else {
208 segmentsToJoin.addAll(newSegs); 208 segmentsToJoin.addAll(newSegs);
209 if (hasTrailingSeparator) { 209 if (hasTrailingSeparator) {
210 segmentsToJoin.add(''); 210 segmentsToJoin.add('');
211 } 211 }
212 } 212 }
213 return new _Path._internal(Strings.join(segmentsToJoin, '/'), 213 return new _Path._internal(segmentsToJoin.join('/'), isWindowsShare);
214 isWindowsShare);
215 } 214 }
216 215
217 String toNativePath() { 216 String toNativePath() {
218 if (Platform.operatingSystem == 'windows') { 217 if (Platform.operatingSystem == 'windows') {
219 String nativePath = _path; 218 String nativePath = _path;
220 // Drop '/' before a drive letter. 219 // Drop '/' before a drive letter.
221 if (nativePath.length >= 3 && 220 if (nativePath.length >= 3 &&
222 nativePath.startsWith('/') && 221 nativePath.startsWith('/') &&
223 nativePath[2] == ':') { 222 nativePath[2] == ':') {
224 nativePath = nativePath.substring(1); 223 nativePath = nativePath.substring(1);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 while (pos > 0 && _path[pos - 1] == '/') --pos; 267 while (pos > 0 && _path[pos - 1] == '/') --pos;
269 var dirPath = (pos > 0) ? _path.substring(0, pos) : '/'; 268 var dirPath = (pos > 0) ? _path.substring(0, pos) : '/';
270 return new _Path._internal(dirPath, isWindowsShare); 269 return new _Path._internal(dirPath, isWindowsShare);
271 } 270 }
272 271
273 String get filename { 272 String get filename {
274 int pos = _path.lastIndexOf('/'); 273 int pos = _path.lastIndexOf('/');
275 return _path.substring(pos + 1); 274 return _path.substring(pos + 1);
276 } 275 }
277 } 276 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/io/process.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698