#ifndef DEF_VFS_VFILE_H #define DEF_VFS_VFILE_H #include #include "node.h" class vfile : public node { char *data; size_t size; bool own_data; // did WE malloc the content of data ? public: vfile(node* parent, char* data = 0, size_t size = 0); virtual ~vfile(); // TODO: handle open(TRUNC) virtual int read(size_t offset, size_t len, char* buffer); virtual int write(size_t offset, size_t len, char* buffer); virtual size_t get_size() { return size; } }; #endif