OLD | NEW |
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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
7 | 7 |
8 library engine.source.io; | 8 library engine.source.io; |
9 | 9 |
10 import 'source.dart'; | 10 import 'source.dart'; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 bool operator ==(Object object) => object != null && this.runtimeType == objec
t.runtimeType && _file == (object as FileBasedSource)._file; | 109 bool operator ==(Object object) => object != null && this.runtimeType == objec
t.runtimeType && _file == (object as FileBasedSource)._file; |
110 | 110 |
111 bool exists() => _contentCache.getContents(this) != null || _file.isFile(); | 111 bool exists() => _contentCache.getContents(this) != null || _file.isFile(); |
112 | 112 |
113 void getContents(Source_ContentReceiver receiver) { | 113 void getContents(Source_ContentReceiver receiver) { |
114 // | 114 // |
115 // First check to see whether our content cache has an override for our cont
ents. | 115 // First check to see whether our content cache has an override for our cont
ents. |
116 // | 116 // |
117 String contents = _contentCache.getContents(this); | 117 String contents = _contentCache.getContents(this); |
118 if (contents != null) { | 118 if (contents != null) { |
119 receiver.accept(new CharSequence(contents), _contentCache.getModificationS
tamp(this)); | 119 receiver.accept(contents, _contentCache.getModificationStamp(this)); |
120 return; | 120 return; |
121 } | 121 } |
122 // | 122 // |
123 // If not, read the contents from the file using native I/O. | 123 // If not, read the contents from the file using native I/O. |
124 // | 124 // |
125 getContentsFromFile(receiver); | 125 getContentsFromFile(receiver); |
126 } | 126 } |
127 | 127 |
128 String get encoding { | 128 String get encoding { |
129 if (_encoding == null) { | 129 if (_encoding == null) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 * will be invoked depends on which of the possible representations of the con
tents is the most | 172 * will be invoked depends on which of the possible representations of the con
tents is the most |
173 * efficient. Whichever method is invoked, it will be invoked before this meth
od returns. | 173 * efficient. Whichever method is invoked, it will be invoked before this meth
od returns. |
174 * | 174 * |
175 * @param receiver the content receiver to which the content of this source wi
ll be passed | 175 * @param receiver the content receiver to which the content of this source wi
ll be passed |
176 * @throws Exception if the contents of this source could not be accessed | 176 * @throws Exception if the contents of this source could not be accessed |
177 * @see #getContents(com.google.dart.engine.source.Source.ContentReceiver) | 177 * @see #getContents(com.google.dart.engine.source.Source.ContentReceiver) |
178 */ | 178 */ |
179 void getContentsFromFile(Source_ContentReceiver receiver) { | 179 void getContentsFromFile(Source_ContentReceiver receiver) { |
180 { | 180 { |
181 } | 181 } |
182 receiver.accept(file.readAsCharSequenceSync(), file.lastModified()); | 182 receiver.accept(file.readAsStringSync(), file.lastModified()); |
183 } | 183 } |
184 | 184 |
185 /** | 185 /** |
186 * Return the file represented by this source. This is an internal method that
is only intended to | 186 * Return the file represented by this source. This is an internal method that
is only intended to |
187 * be used by [UriResolver]. | 187 * be used by [UriResolver]. |
188 * | 188 * |
189 * @return the file represented by this source | 189 * @return the file represented by this source |
190 */ | 190 */ |
191 JavaFile get file => _file; | 191 JavaFile get file => _file; |
192 } | 192 } |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 return null; | 432 return null; |
433 } | 433 } |
434 | 434 |
435 Source resolveAbsolute(ContentCache contentCache, Uri uri) { | 435 Source resolveAbsolute(ContentCache contentCache, Uri uri) { |
436 if (!isFileUri(uri)) { | 436 if (!isFileUri(uri)) { |
437 return null; | 437 return null; |
438 } | 438 } |
439 return new FileBasedSource.con1(contentCache, new JavaFile.fromUri(uri)); | 439 return new FileBasedSource.con1(contentCache, new JavaFile.fromUri(uri)); |
440 } | 440 } |
441 } | 441 } |
OLD | NEW |