OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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_MOUNT_NODE_MEM_H_ | 5 #ifndef LIBRARIES_NACL_IO_MOUNT_NODE_MEM_H_ |
6 #define LIBRARIES_NACL_IO_MOUNT_NODE_MEM_H_ | 6 #define LIBRARIES_NACL_IO_MOUNT_NODE_MEM_H_ |
7 | 7 |
8 #include "nacl_io/mount_node.h" | 8 #include "nacl_io/mount_node.h" |
9 | 9 |
10 class MountNodeMem : public MountNode { | 10 class MountNodeMem : public MountNode { |
11 public: | 11 public: |
12 explicit MountNodeMem(Mount* mount); | 12 explicit MountNodeMem(Mount* mount); |
13 | 13 |
14 protected: | 14 protected: |
15 virtual ~MountNodeMem(); | 15 virtual ~MountNodeMem(); |
16 | 16 |
17 public: | 17 public: |
18 // Normal read/write operations on a file | 18 // Normal read/write operations on a file |
19 virtual int Read(size_t offs, void* buf, size_t count); | 19 virtual Error Read(size_t offs, void* buf, size_t count, int* out_bytes); |
20 virtual int Write(size_t offs, const void* buf, size_t count); | 20 virtual Error Write(size_t offs, |
21 virtual int FTruncate(off_t size); | 21 const void* buf, |
| 22 size_t count, |
| 23 int* out_bytes); |
| 24 virtual Error FTruncate(off_t size); |
22 | 25 |
23 private: | 26 private: |
24 char* data_; | 27 char* data_; |
25 size_t capacity_; | 28 size_t capacity_; |
26 friend class MountMem; | 29 friend class MountMem; |
27 }; | 30 }; |
28 | 31 |
29 #endif // LIBRARIES_NACL_IO_MOUNT_NODE_MEM_H_ | 32 #endif // LIBRARIES_NACL_IO_MOUNT_NODE_MEM_H_ |
OLD | NEW |