mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
Import all this stuff into a single repo called Serenity.
This commit is contained in:
commit
5a30055157
67 changed files with 8836 additions and 0 deletions
40
VirtualFileSystem/InodeIdentifier.h
Normal file
40
VirtualFileSystem/InodeIdentifier.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/Types.h>
|
||||
|
||||
class FileSystem;
|
||||
struct InodeMetadata;
|
||||
|
||||
class InodeIdentifier {
|
||||
public:
|
||||
InodeIdentifier() { }
|
||||
InodeIdentifier(dword fileSystemID, dword inode)
|
||||
: m_fileSystemID(fileSystemID)
|
||||
, m_index(inode)
|
||||
{
|
||||
}
|
||||
|
||||
bool isValid() const { return m_fileSystemID != 0 && m_index != 0; }
|
||||
|
||||
dword fileSystemID() const { return m_fileSystemID; }
|
||||
dword index() const { return m_index; }
|
||||
|
||||
FileSystem* fileSystem();
|
||||
const FileSystem* fileSystem() const;
|
||||
|
||||
bool operator==(const InodeIdentifier& other) const
|
||||
{
|
||||
return m_fileSystemID == other.m_fileSystemID && m_index == other.m_index;
|
||||
}
|
||||
|
||||
InodeMetadata metadata() const;
|
||||
bool isRootInode() const;
|
||||
|
||||
ByteBuffer readEntireFile() const;
|
||||
|
||||
private:
|
||||
dword m_fileSystemID { 0 };
|
||||
dword m_index { 0 };
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue