blob: 7ac1b2a137c560f2658c03fdffd3761d81743a48 (
plain) (
tree)
|
|
#ifndef DEF_VFS_VDIR_H
#define DEF_VFS_VDIR_H
#include "node.h"
#include <lib/earray.h>
#include <lib/std.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 ~vdir() {}
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
|