summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/vfile.h
blob: 9b68b68c692239f0822e7d512a34192ca158f79e (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
#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