Luna/kernel/src/fs/VFS.h

38 lines
603 B
C
Raw Normal View History

#pragma once
#include <luna/SharedPtr.h>
namespace VFS
{
enum class InodeType
{
RegularFile,
Directory
};
class FileSystem;
class Inode
{
public:
virtual Result<Inode*> find(const char* name) const = 0;
virtual FileSystem& fs() const = 0;
virtual ~Inode() = default;
InodeType type;
};
class FileSystem
{
public:
virtual Inode& root() const = 0;
virtual ~FileSystem() = default;
};
extern SharedPtr<FileSystem> root_fs;
Result<Inode*> resolve_path(const char* path);
}