summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/vdir.h
blob: 9595409e45071459f1dd02969a6d11bbab0b017e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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