mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 19:19:44 +03:00
33 lines
850 B
C++
33 lines
850 B
C++
/*
|
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#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; }
|
|
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 NonnullRefPtr<OpenFileDescription> m_file_description;
|
|
};
|
|
|
|
}
|