OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 /// A memory + physical file system used to mock input for tests but provide | 5 /// A memory + physical file system used to mock input for tests but provide |
6 /// sdk sources from disk. | 6 /// sdk sources from disk. |
7 library front_end.src.hybrid_file_system; | 7 library front_end.src.hybrid_file_system; |
8 | 8 |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 return _delegate ??= (await memory.exists()) ? memory : physical; | 38 return _delegate ??= (await memory.exists()) ? memory : physical; |
39 } | 39 } |
40 | 40 |
41 @override | 41 @override |
42 Uri get uri => memory.uri; | 42 Uri get uri => memory.uri; |
43 | 43 |
44 @override | 44 @override |
45 Future<bool> exists() async => (await delegate).exists(); | 45 Future<bool> exists() async => (await delegate).exists(); |
46 | 46 |
47 @override | 47 @override |
48 Future<DateTime> lastModified() async => (await delegate).lastModified(); | |
49 | |
50 @override | |
51 Future<List<int>> readAsBytes() async => (await delegate).readAsBytes(); | 48 Future<List<int>> readAsBytes() async => (await delegate).readAsBytes(); |
52 | 49 |
53 @override | 50 @override |
54 Future<String> readAsString() async => (await delegate).readAsString(); | 51 Future<String> readAsString() async => (await delegate).readAsString(); |
55 } | 52 } |
OLD | NEW |