| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 | |
| 5 // TODO(terry): Investigate common library for file I/O shared between frog and
tools. | |
| 6 | |
| 7 library file_system_memory; | |
| 8 | |
| 9 import 'file_system.dart'; | |
| 10 | |
| 11 /** | |
| 12 * [FileSystem] implementation a memory buffer. | |
| 13 */ | |
| 14 class MemoryFileSystem implements FileSystem { | |
| 15 StringBuffer buffer; | |
| 16 | |
| 17 MemoryFileSystem() : this.buffer = new StringBuffer(); | |
| 18 | |
| 19 void writeString(String outfile, String text) { | |
| 20 buffer.write(text); | |
| 21 } | |
| 22 | |
| 23 String readAll(String filename) { | |
| 24 return buffer.toString(); | |
| 25 } | |
| 26 | |
| 27 bool fileExists(String filename) { | |
| 28 return true; | |
| 29 } | |
| 30 | |
| 31 void createDirectory(String path, [bool recursive]) { | |
| 32 // TODO(terry): To be implement. | |
| 33 throw 'createDirectory() is not implemented by MemoryFileSystem yet.'; | |
| 34 } | |
| 35 | |
| 36 void removeDirectory(String path, [bool recursive]) { | |
| 37 // TODO(terry): To be implement. | |
| 38 throw 'removeDirectory() is not implemented by MemoryFileSystem yet.'; | |
| 39 } | |
| 40 } | |
| OLD | NEW |