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

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

Issue 444193002: Add Folder.contains(path) and use it in ContextDirectoryManager. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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
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 physical_file_system; 5 library physical_file_system;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io' as io; 8 import 'dart:io' as io;
9 9
10 import 'package:analyzer/src/generated/java_io.dart'; 10 import 'package:analyzer/src/generated/java_io.dart';
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 @override 67 @override
68 Stream<WatchEvent> get changes => new DirectoryWatcher(_entry.path).events; 68 Stream<WatchEvent> get changes => new DirectoryWatcher(_entry.path).events;
69 69
70 @override 70 @override
71 String canonicalizePath(String relPath) { 71 String canonicalizePath(String relPath) {
72 return normalize(join(_entry.absolute.path, relPath)); 72 return normalize(join(_entry.absolute.path, relPath));
73 } 73 }
74 74
75 @override 75 @override
76 bool contains(String path) {
77 return posix.isWithin(this.path, path);
78 }
79
80 @override
76 Resource getChild(String relPath) { 81 Resource getChild(String relPath) {
77 String canonicalPath = canonicalizePath(relPath); 82 String canonicalPath = canonicalizePath(relPath);
78 return PhysicalResourceProvider.INSTANCE.getResource(canonicalPath); 83 return PhysicalResourceProvider.INSTANCE.getResource(canonicalPath);
79 } 84 }
80 85
81 @override 86 @override
82 List<Resource> getChildren() { 87 List<Resource> getChildren() {
83 List<Resource> children = <Resource>[]; 88 List<Resource> children = <Resource>[];
84 io.Directory directory = _entry as io.Directory; 89 io.Directory directory = _entry as io.Directory;
85 List<io.FileSystemEntity> entries = directory.listSync(recursive: false); 90 List<io.FileSystemEntity> entries = directory.listSync(recursive: false);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 bool operator ==(other) { 135 bool operator ==(other) {
131 if (runtimeType != other.runtimeType) { 136 if (runtimeType != other.runtimeType) {
132 return false; 137 return false;
133 } 138 }
134 return path == other.path; 139 return path == other.path;
135 } 140 }
136 141
137 @override 142 @override
138 String toString() => path; 143 String toString() => path;
139 } 144 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/file_system/memory_file_system.dart ('k') | pkg/analyzer/test/file_system/memory_file_system_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698