Chromium Code Reviews| Index: frog/file_system_memory.dart |
| diff --git a/frog/file_system_memory.dart b/frog/file_system_memory.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ca718def98e87d3e1dec53470f5fa926fc6a2c9c |
| --- /dev/null |
| +++ b/frog/file_system_memory.dart |
| @@ -0,0 +1,29 @@ |
| +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +#library('file_system_memory'); |
| + |
| +#import('dart:dom'); |
| +#import('file_system.dart'); |
| + |
| +/** |
| + * [FileSystem] implementation a memory buffer. |
|
jimhug
2011/11/10 17:58:56
This makes a lot of sense to me. I have some nigg
|
| + */ |
| +class MemoryFileSystem implements FileSystem { |
| + StringBuffer buffer; |
| + |
| + MemoryFileSystem() : this.buffer = new StringBuffer(); |
| + |
| + void writeString(String outfile, String text) { |
| + buffer.add(text); |
| + } |
| + |
| + String readAll(String filename) { |
| + return buffer.toString(); |
| + } |
| + |
| + bool fileExists(String filename) { |
| + return true; |
| + } |
| +} |