diff options
Diffstat (limited to 'Source/Kernel/VFS/FileNode.class.h')
-rw-r--r-- | Source/Kernel/VFS/FileNode.class.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/Kernel/VFS/FileNode.class.h b/Source/Kernel/VFS/FileNode.class.h new file mode 100644 index 0000000..29fab45 --- /dev/null +++ b/Source/Kernel/VFS/FileNode.class.h @@ -0,0 +1,28 @@ +#ifndef DEF_FILENODE_CLASS_H +#define DEF_FILENODE_CLASS_H + +#include <VFS/FSNode.proto.h> + +class FileNode : public FSNode { + protected: + FileNode(String name, FileSystem* fs, FSNode* parent, u32int length = 0, u32int permissions = 0777, + u32int uid = 0, u32int gid = 0): FSNode(name, fs, parent, length, permissions, uid, gid) {} + + public: + u8int type() { return NT_FILE; } + + u32int read(u64int position, u32int max_length, u8int *data) { + return m_fs->read(this, position, max_length, data); + } + + bool write(u64int position, u32int length, u8int *data) { + return m_fs->write(this, position, length, data); + } + + bool truncate() { + return m_fs->truncate(this); + } + +}; + +#endif |