summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/vdir.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/vfs/vdir.h')
-rw-r--r--src/kernel/vfs/vdir.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/kernel/vfs/vdir.h b/src/kernel/vfs/vdir.h
new file mode 100644
index 0000000..9595409
--- /dev/null
+++ b/src/kernel/vfs/vdir.h
@@ -0,0 +1,32 @@
+#ifndef DEF_VFS_VDIR_H
+#define DEF_VFS_VDIR_H
+
+#include "node.h"
+#include <lib/earray.h>
+#include <string.h>
+
+struct vdir_child {
+ char* name;
+ node *el;
+
+ vdir_child(char* na, node* nd) : el(nd) {
+ name = strdup(na);
+ }
+};
+
+class vdir : public node {
+ earray<vdir_child> children;
+ size_t child_count;
+
+ public:
+ vdir(node* parent);
+
+ virtual int read(size_t offset, size_t len, char* buffer);
+ virtual int write(size_t offset, size_t len, char* buffer); // rename file
+ virtual node* get_child(char* name);
+ virtual int add_child(char* name, node *child);
+ virtual size_t get_size();
+};
+
+#endif
+