summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/vfile.h
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-18 14:47:44 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-18 14:47:44 +0200
commit7d5a38ada35ac196919c26675f211adb995b84ae (patch)
tree60d9733a1ca44ff873dbac610ea367863d5c648b /src/kernel/vfs/vfile.h
parent1ecb3fb821f49450ba4b08ad7d7a23d3acb75c47 (diff)
downloadTCE-7d5a38ada35ac196919c26675f211adb995b84ae.tar.gz
TCE-7d5a38ada35ac196919c26675f211adb995b84ae.zip
Added initrd. Status: VFS support, totally useless shell.
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