blob: 6aacc2f53d5ea44c364bd0e496358724270fb8b7 (
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
33
34
35
36
37
|
#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);
}
virtual ~vdir_child() {
free(name);
}
};
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
|