OLD | NEW |
| (Empty) |
1 // Copyright (c) 2016, 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 #ifndef VM_DEV_FS_H_ | |
6 #define VM_DEV_FS_H_ | |
7 | |
8 #include "vm/globals.h" | |
9 | |
10 #include "vm/dart_api_impl.h" | |
11 | |
12 namespace dart { | |
13 | |
14 class Array; | |
15 class FileSystem; | |
16 class JSONStream; | |
17 class Mutex; | |
18 class ObjectPointerVisitor; | |
19 class RawArray; | |
20 class RawObject; | |
21 class String; | |
22 | |
23 | |
24 // Manages dart-devfs:// file systems. These file systems are "virtual" | |
25 // and accessed via the service protocol. | |
26 class DevFS { | |
27 public: | |
28 static void Init(); | |
29 static void Cleanup(); | |
30 | |
31 static void ListFileSystems(JSONStream* js); | |
32 static void CreateFileSystem(JSONStream* js, const String& fs_name); | |
33 static void DeleteFileSystem(JSONStream* js, const String& fs_name); | |
34 static void ListFiles(JSONStream* js, | |
35 const String& fs_name); | |
36 static void WriteFiles(JSONStream* js, | |
37 const String& fs_name, | |
38 const Array& files); | |
39 static void WriteFile(JSONStream* js, | |
40 const String& fs_name, | |
41 const String& path, | |
42 const String& file_contents); | |
43 static void ReadFile(JSONStream* js, | |
44 const String& fs_name, | |
45 const String& path); | |
46 | |
47 private: | |
48 static Mutex* mutex_; | |
49 static FileSystem* LookupFileSystem(const String& fs_name); | |
50 static FileSystem* LookupFileSystem(const char* fs_name); | |
51 }; | |
52 | |
53 } // namespace dart | |
54 | |
55 #endif // VM_DEV_FS_H_ | |
OLD | NEW |