2020-01-18 05:38:21 -03:00
|
|
|
/*
|
2020-12-26 11:53:30 -03:00
|
|
|
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
|
2020-01-18 05:38:21 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 05:38:21 -03:00
|
|
|
*/
|
|
|
|
|
|
2020-12-26 11:53:30 -03:00
|
|
|
#include <Kernel/Storage/Partition/PartitionTable.h>
|
2019-10-06 21:12:37 -03:00
|
|
|
|
2020-02-15 21:27:42 -03:00
|
|
|
namespace Kernel {
|
2020-12-26 11:53:30 -03:00
|
|
|
PartitionTable::PartitionTable(const StorageDevice& device)
|
|
|
|
|
: m_device(device)
|
2020-02-01 13:17:50 -03:00
|
|
|
{
|
2020-12-26 11:53:30 -03:00
|
|
|
}
|
2019-10-06 21:12:37 -03:00
|
|
|
|
2020-12-26 11:53:30 -03:00
|
|
|
Optional<DiskPartitionMetadata> PartitionTable::partition(unsigned index)
|
2020-02-01 13:17:50 -03:00
|
|
|
{
|
2020-12-26 11:53:30 -03:00
|
|
|
if (index > partitions_count())
|
|
|
|
|
return {};
|
|
|
|
|
return m_partitions[index];
|
|
|
|
|
}
|
2020-02-15 21:27:42 -03:00
|
|
|
|
|
|
|
|
}
|