#pragma once #include namespace VFS { enum class InodeType { RegularFile, Directory }; class FileSystem; class Inode { public: virtual Result> find(const char* name) const = 0; virtual FileSystem& fs() const = 0; virtual ~Inode() = default; virtual InodeType type() const = 0; virtual usize inode_number() const = 0; }; class FileInode : Inode { public: Result> find(const char*) const override { return err(ENOTDIR); } InodeType type() const override { return InodeType::RegularFile; } virtual ~FileInode() = default; }; class FileSystem { public: virtual Inode& root_inode() const = 0; virtual Result> create_file_inode() = 0; virtual ~FileSystem() = default; }; extern SharedPtr root_fs; Result resolve_path(const char* path); Inode& root_inode(); }