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

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

Issue 2058163002: Add Folder.getChildAssumingFile(). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/file_system/memory_file_system.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) 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.file_system; 5 library analyzer.file_system.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:analyzer/src/util/absolute_path.dart'; 10 import 'package:analyzer/src/util/absolute_path.dart';
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 */ 99 */
100 bool contains(String path); 100 bool contains(String path);
101 101
102 /** 102 /**
103 * Return an existing child [Resource] with the given [relPath]. 103 * Return an existing child [Resource] with the given [relPath].
104 * Return a not existing [File] if no such child exist. 104 * Return a not existing [File] if no such child exist.
105 */ 105 */
106 Resource getChild(String relPath); 106 Resource getChild(String relPath);
107 107
108 /** 108 /**
109 * Return a [File] representing a child [Resource] with the given
110 * [relPath]. This call does not check whether a file with the given name
111 * exists on the filesystem - client must call the [File]'s `exists` getter
112 * to determine whether the folder actually exists.
113 */
114 File getChildAssumingFile(String relPath);
115
116 /**
109 * Return a [Folder] representing a child [Resource] with the given 117 * Return a [Folder] representing a child [Resource] with the given
110 * [relPath]. This call does not check whether a folder with the given name 118 * [relPath]. This call does not check whether a folder with the given name
111 * exists on the filesystem--client must call the [Folder]'s `exists` getter 119 * exists on the filesystem--client must call the [Folder]'s `exists` getter
112 * to determine whether the folder actually exists. 120 * to determine whether the folder actually exists.
113 */ 121 */
114 Folder getChildAssumingFolder(String relPath); 122 Folder getChildAssumingFolder(String relPath);
115 123
116 /** 124 /**
117 * Return a list of existing direct children [Resource]s (folders and files) 125 * Return a list of existing direct children [Resource]s (folders and files)
118 * in this folder, in no particular order. 126 * in this folder, in no particular order.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 233
226 @override 234 @override
227 Uri restoreAbsolute(Source source) => 235 Uri restoreAbsolute(Source source) =>
228 _provider.pathContext.toUri(source.fullName); 236 _provider.pathContext.toUri(source.fullName);
229 237
230 /** 238 /**
231 * Return `true` if the given [uri] is a `file` URI. 239 * Return `true` if the given [uri] is a `file` URI.
232 */ 240 */
233 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; 241 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME;
234 } 242 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/file_system/memory_file_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698