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