OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef LIBRARIES_NACL_IO_MEMFS_MEM_FS_H_ | 5 #ifndef LIBRARIES_NACL_IO_MEMFS_MEM_FS_H_ |
6 #define LIBRARIES_NACL_IO_MEMFS_MEM_FS_H_ | 6 #define LIBRARIES_NACL_IO_MEMFS_MEM_FS_H_ |
7 | 7 |
8 #include "nacl_io/filesystem.h" | 8 #include "nacl_io/filesystem.h" |
9 #include "nacl_io/typed_fs_factory.h" | 9 #include "nacl_io/typed_fs_factory.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 // required to use correct locking as needed. | 22 // required to use correct locking as needed. |
23 | 23 |
24 // Allocate or free an INODE number. | 24 // Allocate or free an INODE number. |
25 int AllocateINO(); | 25 int AllocateINO(); |
26 void FreeINO(int ino); | 26 void FreeINO(int ino); |
27 | 27 |
28 // Find a Node specified node optionally failing if type does not match. | 28 // Find a Node specified node optionally failing if type does not match. |
29 virtual Error FindNode(const Path& path, int type, ScopedNode* out_node); | 29 virtual Error FindNode(const Path& path, int type, ScopedNode* out_node); |
30 | 30 |
31 public: | 31 public: |
32 virtual Error Open(const Path& path, int mode, ScopedNode* out_node); | 32 virtual Error OpenWithMode(const Path& path, int open_flags, mode_t mode, |
| 33 ScopedNode* out_node); |
33 virtual Error Unlink(const Path& path); | 34 virtual Error Unlink(const Path& path); |
34 virtual Error Mkdir(const Path& path, int perm); | 35 virtual Error Mkdir(const Path& path, int perm); |
35 virtual Error Rmdir(const Path& path); | 36 virtual Error Rmdir(const Path& path); |
36 virtual Error Remove(const Path& path); | 37 virtual Error Remove(const Path& path); |
37 virtual Error Rename(const Path& path, const Path& newpath); | 38 virtual Error Rename(const Path& path, const Path& newpath); |
38 | 39 |
39 private: | 40 private: |
40 static const int REMOVE_DIR = 1; | 41 static const int REMOVE_DIR = 1; |
41 static const int REMOVE_FILE = 2; | 42 static const int REMOVE_FILE = 2; |
42 static const int REMOVE_ALL = REMOVE_DIR | REMOVE_FILE; | 43 static const int REMOVE_ALL = REMOVE_DIR | REMOVE_FILE; |
43 | 44 |
44 Error RemoveInternal(const Path& path, int remove_type); | 45 Error RemoveInternal(const Path& path, int remove_type); |
45 | 46 |
46 ScopedNode root_; | 47 ScopedNode root_; |
47 | 48 |
48 friend class TypedFsFactory<MemFs>; | 49 friend class TypedFsFactory<MemFs>; |
49 DISALLOW_COPY_AND_ASSIGN(MemFs); | 50 DISALLOW_COPY_AND_ASSIGN(MemFs); |
50 }; | 51 }; |
51 | 52 |
52 } // namespace nacl_io | 53 } // namespace nacl_io |
53 | 54 |
54 #endif // LIBRARIES_NACL_IO_MEMFS_MEM_FS_H_ | 55 #endif // LIBRARIES_NACL_IO_MEMFS_MEM_FS_H_ |
OLD | NEW |