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

Side by Side Diff: pkg/analyzer/lib/file_system/memory_file_system.dart

Issue 2542793003: Make MemoryResourceProvider.convertPath() work with partially posix paths. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 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 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 analyzer.file_system.memory_file_system; 5 library analyzer.file_system.memory_file_system;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'dart:core'; 10 import 'dart:core';
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 @override 43 @override
44 pathos.Context get pathContext => _pathContext; 44 pathos.Context get pathContext => _pathContext;
45 45
46 /** 46 /**
47 * Convert the given posix [path] to conform to this provider's path context. 47 * Convert the given posix [path] to conform to this provider's path context.
48 * 48 *
49 * This is a utility method for testing; paths passed in to other methods in 49 * This is a utility method for testing; paths passed in to other methods in
50 * this class are never converted automatically. 50 * this class are never converted automatically.
51 */ 51 */
52 String convertPath(String path) { 52 String convertPath(String path) {
53 if (pathContext.style == pathos.windows.style && 53 if (pathContext.style == pathos.windows.style) {
54 path.startsWith(pathos.posix.separator)) { 54 if (path.startsWith(pathos.posix.separator)) {
55 path = r'C:' + 55 path = r'C:' + path;
56 path.replaceAll(pathos.posix.separator, pathos.windows.separator); 56 }
57 path = path.replaceAll(pathos.posix.separator, pathos.windows.separator);
57 } 58 }
58 return path; 59 return path;
59 } 60 }
60 61
61 /** 62 /**
62 * Delete the file with the given path. 63 * Delete the file with the given path.
63 */ 64 */
64 void deleteFile(String path) { 65 void deleteFile(String path) {
65 _checkFileAtPath(path); 66 _checkFileAtPath(path);
66 _pathToResource.remove(path); 67 _pathToResource.remove(path);
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 } 575 }
575 return path == other.path; 576 return path == other.path;
576 } 577 }
577 578
578 @override 579 @override
579 String toString() => path; 580 String toString() => path;
580 581
581 @override 582 @override
582 Uri toUri() => _provider.pathContext.toUri(path); 583 Uri toUri() => _provider.pathContext.toUri(path);
583 } 584 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698