| 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 namespace dart { |
| 11 |
| 12 class Array; |
| 13 class JSONStream; |
| 14 class Mutex; |
| 15 class ObjectPointerVisitor; |
| 16 class RawArray; |
| 17 class RawObject; |
| 18 class String; |
| 19 |
| 20 class DevFS { |
| 21 public: |
| 22 static void Init(); |
| 23 |
| 24 static void ListFileSystems(JSONStream* js); |
| 25 static void CreateFileSystem(JSONStream* js, const char* fs_name); |
| 26 static void DeleteFileSystem(JSONStream* js, const char* fs_name); |
| 27 static void WriteFile(JSONStream* js, |
| 28 const char* fs_name, |
| 29 const char* path, |
| 30 const char* file_contents); |
| 31 static void ReadFile(JSONStream* js, |
| 32 const char* fs_name, |
| 33 const char* path); |
| 34 |
| 35 static void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 36 |
| 37 private: |
| 38 static void EnsureStorage(); |
| 39 static RawArray* LookupFileSystem(const String& fs_name); |
| 40 static bool UpdateFileSystem(const String& fs_name, const Array& fs_contents); |
| 41 |
| 42 static Mutex* mutex_; |
| 43 |
| 44 static RawObject** from() { |
| 45 return reinterpret_cast<RawObject**>(&fs_map_storage_); |
| 46 } |
| 47 static RawArray* fs_map_storage_; |
| 48 static RawObject** to() { |
| 49 return reinterpret_cast<RawObject**>(&fs_map_storage_); |
| 50 } |
| 51 }; |
| 52 |
| 53 } // namespace dart |
| 54 |
| 55 #endif // VM_DEV_FS_H_ |
| OLD | NEW |