ladybird/Kernel/FileSystem/FileBackedFileSystem.h

33 lines
854 B
C
Raw Normal View History

/*
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
2020-02-16 03:50:16 +03:00
#include <Kernel/FileSystem/FileSystem.h>
#include <Kernel/FileSystem/OpenFileDescription.h>
namespace Kernel {
class FileBackedFileSystem : public FileSystem {
public:
virtual ~FileBackedFileSystem() override;
File& file() { return m_file_description->file(); }
OpenFileDescription& file_description() { return *m_file_description; }
2022-04-01 20:58:27 +03:00
File const& file() const { return m_file_description->file(); }
OpenFileDescription& file_description() const { return *m_file_description; }
protected:
explicit FileBackedFileSystem(OpenFileDescription&);
private:
virtual bool is_file_backed() const override { return true; }
mutable NonnullLockRefPtr<OpenFileDescription> m_file_description;
};
}