summaryrefslogtreecommitdiff
path: root/Source/Kernel/VFS/FileSystem.proto.h
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-09-13 15:14:13 +0200
committerAlexis211 <alexis211@gmail.com>2009-09-13 15:14:13 +0200
commit0b760a50b5aee05f1f34c1599b547c8b78d1d737 (patch)
tree8271581cdf49d2eef265d31bd9e1fc30c0ecaf4f /Source/Kernel/VFS/FileSystem.proto.h
parentb808b613a5c7e0b6c6c45b28f7f0169dc13afaa2 (diff)
downloadMelon-0b760a50b5aee05f1f34c1599b547c8b78d1d737.tar.gz
Melon-0b760a50b5aee05f1f34c1599b547c8b78d1d737.zip
Ram file system seems to work \o/
Diffstat (limited to 'Source/Kernel/VFS/FileSystem.proto.h')
-rw-r--r--Source/Kernel/VFS/FileSystem.proto.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/Kernel/VFS/FileSystem.proto.h b/Source/Kernel/VFS/FileSystem.proto.h
index 523caf7..79bb84c 100644
--- a/Source/Kernel/VFS/FileSystem.proto.h
+++ b/Source/Kernel/VFS/FileSystem.proto.h
@@ -1,4 +1,35 @@
#ifndef DEF_FILESYSTEM_PROTO_H
#define DEF_FILESYSTEM_PROTO_H
+#include <VFS/Partition.class.h>
+class FSNode;
+class FileNode;
+class DirectoryNode;
+
+//This abstract class describes a filesystem
+class FileSystem {
+ protected:
+ bool m_isWritable; //false = read only
+ DirectoryNode* m_rootNode;
+
+ public:
+ bool isWritable() { return m_isWritable; }
+ DirectoryNode* getRootNode() { return m_rootNode; }
+
+ //Must be implemented by the filesystem
+ virtual bool setName(FSNode* node, String name) = 0;
+ virtual bool setPermissions(FSNode* node, u32int permissions) = 0;
+ virtual bool setUid(FSNode* node, u32int uid) = 0;
+ virtual bool setGid(FSNode* node, u32int gid) = 0;
+ virtual bool setParent(FSNode* node, FSNode* parent) = 0;
+
+ virtual u32int read(FileNode* file, u64int position, u32int max_length, u8int *data) = 0;
+ virtual bool write(FileNode* file, u64int position, u32int length, u8int *data) = 0;
+ virtual bool truncate(FileNode* file) = 0;
+
+ virtual bool loadContents(DirectoryNode* dir) = 0;
+ virtual FileNode* createFile(DirectoryNode* parent, String name) = 0;
+ virtual DirectoryNode* createDirectory(DirectoryNode* parent, String name) = 0;
+};
+
#endif