EBRPartitionTable.h 1.0 KB

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