Kernel+LibPartition: Move PartitionTable into LibPartition

This commit is contained in:
Samuel Bowman 2022-03-01 18:09:46 -05:00 committed by Linus Groh
commit 940dde9947
Notes: sideshowbarker 2024-07-17 08:41:42 +09:00
8 changed files with 42 additions and 43 deletions

View file

@ -0,0 +1,23 @@
/*
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibPartition/PartitionTable.h>
namespace Partition {
PartitionTable::PartitionTable(Kernel::StorageDevice const& device)
: m_device(device)
{
}
Optional<DiskPartitionMetadata> PartitionTable::partition(unsigned index)
{
if (index > partitions_count())
return {};
return m_partitions[index];
}
}