| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 TimestampedData<String> get contents { | 101 TimestampedData<String> get contents { |
| 102 TimeCounter_TimeCounterHandle handle = PerformanceStatistics.io.start(); | 102 TimeCounter_TimeCounterHandle handle = PerformanceStatistics.io.start(); |
| 103 try { | 103 try { |
| 104 return contentsFromFile; | 104 return contentsFromFile; |
| 105 } finally { | 105 } finally { |
| 106 handle.stop(); | 106 handle.stop(); |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| 110 void getContentsToReceiver(Source_ContentReceiver receiver) { | |
| 111 TimeCounter_TimeCounterHandle handle = PerformanceStatistics.io.start(); | |
| 112 try { | |
| 113 getContentsFromFileToReceiver(receiver); | |
| 114 } finally { | |
| 115 handle.stop(); | |
| 116 } | |
| 117 } | |
| 118 | |
| 119 String get encoding { | 110 String get encoding { |
| 120 if (_encoding == null) { | 111 if (_encoding == null) { |
| 121 _encoding = "${_uriKind.encoding}${_file.toURI().toString()}"; | 112 _encoding = "${_uriKind.encoding}${_file.toURI().toString()}"; |
| 122 } | 113 } |
| 123 return _encoding; | 114 return _encoding; |
| 124 } | 115 } |
| 125 | 116 |
| 126 String get fullName => _file.getAbsolutePath(); | 117 String get fullName => _file.getAbsolutePath(); |
| 127 | 118 |
| 128 int get modificationStamp => _file.lastModified(); | 119 int get modificationStamp => _file.lastModified(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 * | 151 * |
| 161 * @return the contents of the source paired with the modification stamp of th
e source | 152 * @return the contents of the source paired with the modification stamp of th
e source |
| 162 * @throws Exception if the contents of this source could not be accessed | 153 * @throws Exception if the contents of this source could not be accessed |
| 163 * @see #getContents() | 154 * @see #getContents() |
| 164 */ | 155 */ |
| 165 TimestampedData<String> get contentsFromFile { | 156 TimestampedData<String> get contentsFromFile { |
| 166 return new TimestampedData<String>(_file.lastModified(), _file.readAsStringS
ync()); | 157 return new TimestampedData<String>(_file.lastModified(), _file.readAsStringS
ync()); |
| 167 } | 158 } |
| 168 | 159 |
| 169 /** | 160 /** |
| 170 * Get the contents of underlying file and pass it to the given receiver. | |
| 171 * | |
| 172 * @param receiver the content receiver to which the content of this source wi
ll be passed | |
| 173 * @throws Exception if the contents of this source could not be accessed | |
| 174 * @see #getContentsToReceiver(ContentReceiver) | |
| 175 */ | |
| 176 void getContentsFromFileToReceiver(Source_ContentReceiver receiver) { | |
| 177 throw new UnsupportedOperationException(); | |
| 178 } | |
| 179 | |
| 180 /** | |
| 181 * Return the file represented by this source. This is an internal method that
is only intended to | 161 * Return the file represented by this source. This is an internal method that
is only intended to |
| 182 * be used by subclasses of [UriResolver] that are designed to work with file-
based sources. | 162 * be used by subclasses of [UriResolver] that are designed to work with file-
based sources. |
| 183 * | 163 * |
| 184 * @return the file represented by this source | 164 * @return the file represented by this source |
| 185 */ | 165 */ |
| 186 JavaFile get file => _file; | 166 JavaFile get file => _file; |
| 187 } | 167 } |
| 188 | 168 |
| 189 /** | 169 /** |
| 190 * Instances of the class `PackageUriResolver` resolve `package` URI's in the co
ntext of | 170 * Instances of the class `PackageUriResolver` resolve `package` URI's in the co
ntext of |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 return null; | 401 return null; |
| 422 } | 402 } |
| 423 | 403 |
| 424 Source resolveAbsolute(Uri uri) { | 404 Source resolveAbsolute(Uri uri) { |
| 425 if (!isFileUri(uri)) { | 405 if (!isFileUri(uri)) { |
| 426 return null; | 406 return null; |
| 427 } | 407 } |
| 428 return new FileBasedSource.con1(new JavaFile.fromUri(uri)); | 408 return new FileBasedSource.con1(new JavaFile.fromUri(uri)); |
| 429 } | 409 } |
| 430 } | 410 } |
| OLD | NEW |