ladybird/Kernel/FileSystem/FileBackedFileSystem.h

33 lines
830 B
C
Raw Normal View History

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