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

Side by Side Diff: pkg/analyzer/lib/file_system/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 file_system; 5 library file_system;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/src/generated/source.dart'; 9 import 'package:analyzer/src/generated/source.dart';
10 import 'package:path/path.dart'; 10 import 'package:path/path.dart';
(...skipping 25 matching lines...) Expand all
36 * If the path [path] is a relative path, convert it to an absolute path 36 * If the path [path] is a relative path, convert it to an absolute path
37 * by interpreting it relative to this folder. If it is already an aboslute 37 * by interpreting it relative to this folder. If it is already an aboslute
38 * path, then don't change it. 38 * path, then don't change it.
39 * 39 *
40 * However, regardless of whether [path] is relative or absolute, normalize 40 * However, regardless of whether [path] is relative or absolute, normalize
41 * it by removing path components of the form '.' or '..'. 41 * it by removing path components of the form '.' or '..'.
42 */ 42 */
43 String canonicalizePath(String path); 43 String canonicalizePath(String path);
44 44
45 /** 45 /**
46 * Return `true` if absolute [path] references a resource in this folder.
47 */
48 bool contains(String path);
49
50 /**
46 * Return an existing child [Resource] with the given [relPath]. 51 * Return an existing child [Resource] with the given [relPath].
47 * Return a not existing [File] if no such child exist. 52 * Return a not existing [File] if no such child exist.
48 */ 53 */
49 Resource getChild(String relPath); 54 Resource getChild(String relPath);
50 55
51 /** 56 /**
52 * Return a list of existing direct children [Resource]s (folders and files) 57 * Return a list of existing direct children [Resource]s (folders and files)
53 * in this folder, in no particular order. 58 * in this folder, in no particular order.
54 */ 59 */
55 List<Resource> getChildren(); 60 List<Resource> getChildren();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 132 }
128 133
129 /** 134 /**
130 * Return `true` if the given URI is a `file` URI. 135 * Return `true` if the given URI is a `file` URI.
131 * 136 *
132 * @param uri the URI being tested 137 * @param uri the URI being tested
133 * @return `true` if the given URI is a `file` URI 138 * @return `true` if the given URI is a `file` URI
134 */ 139 */
135 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; 140 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME;
136 } 141 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/context_directory_manager.dart ('k') | pkg/analyzer/lib/file_system/memory_file_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698