summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/vfile.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/vfs/vfile.h')
-rw-r--r--src/kernel/vfs/vfile.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/kernel/vfs/vfile.h b/src/kernel/vfs/vfile.h
new file mode 100644
index 0000000..9b68b68
--- /dev/null
+++ b/src/kernel/vfs/vfile.h
@@ -0,0 +1,23 @@
+#ifndef DEF_VFS_VFILE_H
+#define DEF_VFS_VFILE_H
+
+#include <lib/std.h>
+#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