| 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 library memory_file_system; | 5 library memory_file_system; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:core' hide Resource; | 9 import 'dart:core' hide Resource; |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 throw 'failed to delete resource: $child'; | 58 throw 'failed to delete resource: $child'; |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 _pathToResource.remove(path); | 61 _pathToResource.remove(path); |
| 62 _pathToContent.remove(path); | 62 _pathToContent.remove(path); |
| 63 _pathToTimestamp.remove(path); | 63 _pathToTimestamp.remove(path); |
| 64 _notifyWatchers(path, ChangeType.REMOVE); | 64 _notifyWatchers(path, ChangeType.REMOVE); |
| 65 } | 65 } |
| 66 | 66 |
| 67 @override | 67 @override |
| 68 File getFile(String path) => new _MemoryFile(this, path); | |
| 69 | |
| 70 @override | |
| 71 Folder getFolder(String path) => newFolder(path); | |
| 72 | |
| 73 @override | |
| 74 Resource getResource(String path) { | 68 Resource getResource(String path) { |
| 75 path = posix.normalize(path); | 69 path = posix.normalize(path); |
| 76 Resource resource = _pathToResource[path]; | 70 Resource resource = _pathToResource[path]; |
| 77 if (resource == null) { | 71 if (resource == null) { |
| 78 resource = new _MemoryFile(this, path); | 72 resource = new _MemoryFile(this, path); |
| 79 } | 73 } |
| 80 return resource; | 74 return resource; |
| 81 } | 75 } |
| 82 | 76 |
| 83 @override | 77 @override |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 bool operator ==(other) { | 466 bool operator ==(other) { |
| 473 if (runtimeType != other.runtimeType) { | 467 if (runtimeType != other.runtimeType) { |
| 474 return false; | 468 return false; |
| 475 } | 469 } |
| 476 return path == other.path; | 470 return path == other.path; |
| 477 } | 471 } |
| 478 | 472 |
| 479 @override | 473 @override |
| 480 String toString() => path; | 474 String toString() => path; |
| 481 } | 475 } |
| OLD | NEW |