mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00
Kernel+LibPartition: Move PartitionTable into LibPartition
This commit is contained in:
parent
be1c5c6b9f
commit
940dde9947
8 changed files with 42 additions and 43 deletions
23
Userland/Libraries/LibPartition/PartitionTable.cpp
Normal file
23
Userland/Libraries/LibPartition/PartitionTable.cpp
Normal 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];
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue