Serenity Operating System
at master 41 lines 1.0 kB view raw
1/* 2 * Copyright (c) 2020-2022, Liav A. <liavalb@hotmail.co.il> 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 */ 6 7#pragma once 8 9#include <LibPartition/MBRPartitionTable.h> 10 11namespace Partition { 12 13struct EBRPartitionHeader; 14class EBRPartitionTable : public MBRPartitionTable { 15public: 16 ~EBRPartitionTable(); 17 18#ifdef KERNEL 19 static ErrorOr<NonnullOwnPtr<EBRPartitionTable>> try_to_initialize(Kernel::StorageDevice&); 20 explicit EBRPartitionTable(Kernel::StorageDevice&); 21#else 22 static ErrorOr<NonnullOwnPtr<EBRPartitionTable>> try_to_initialize(NonnullRefPtr<Core::DeprecatedFile>); 23 explicit EBRPartitionTable(NonnullRefPtr<Core::DeprecatedFile>); 24#endif 25 26 virtual bool is_valid() const override 27 { 28 return m_valid; 29 } 30 31private: 32#ifdef KERNEL 33 void search_extended_partition(Kernel::StorageDevice&, MBRPartitionTable&, u64, size_t limit); 34#else 35 void search_extended_partition(NonnullRefPtr<Core::DeprecatedFile>, MBRPartitionTable&, u64, size_t limit); 36#endif 37 38 bool m_valid { false }; 39}; 40 41}