/* * Copyright (c) 2020, Liav A. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace Kernel { class PartitionTable { public: enum class Error { Invalid, MBRProtective, ConatinsEBR, }; public: Optional partition(unsigned index); size_t partitions_count() const { return m_partitions.size(); } virtual ~PartitionTable() = default; virtual bool is_valid() const = 0; Vector partitions() const { return m_partitions; } protected: explicit PartitionTable(const StorageDevice&); NonnullRefPtr m_device; Vector m_partitions; }; }