Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / native_client_sdk / src / libraries / nacl_io / memfs / mem_fs_node.h
blob77a327a31f02a30aa1e4c386c678882093492951
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
3 // found in the LICENSE file.
5 #ifndef LIBRARIES_NACL_IO_MEMFS_MEM_FS_NODE_H_
6 #define LIBRARIES_NACL_IO_MEMFS_MEM_FS_NODE_H_
8 #include "nacl_io/node.h"
10 namespace nacl_io {
12 class MemFsNode : public Node {
13 public:
14 explicit MemFsNode(Filesystem* filesystem);
16 protected:
17 virtual ~MemFsNode();
19 public:
20 // Normal read/write operations on a file
21 virtual Error Read(const HandleAttr& attr,
22 void* buf,
23 size_t count,
24 int* out_bytes);
25 virtual Error Write(const HandleAttr& attr,
26 const void* buf,
27 size_t count,
28 int* out_bytes);
29 virtual Error FTruncate(off_t size);
31 private:
32 Error Resize(off_t size);
34 char* data_;
35 size_t data_capacity_;
36 friend class MemFs;
39 } // namespace nacl_io
41 #endif // LIBRARIES_NACL_IO_MEMFS_MEM_FS_NODE_H_