mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +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
30
Userland/Libraries/LibPartition/PartitionTable.h
Normal file
30
Userland/Libraries/LibPartition/PartitionTable.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright (c) 2020-2022, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Kernel/Storage/StorageDevice.h>
|
||||
#include <LibPartition/DiskPartitionMetadata.h>
|
||||
|
||||
namespace Partition {
|
||||
|
||||
class PartitionTable {
|
||||
public:
|
||||
Optional<DiskPartitionMetadata> partition(unsigned index);
|
||||
size_t partitions_count() const { return m_partitions.size(); }
|
||||
virtual ~PartitionTable() = default;
|
||||
virtual bool is_valid() const = 0;
|
||||
|
||||
Vector<DiskPartitionMetadata> partitions() const { return m_partitions; }
|
||||
|
||||
protected:
|
||||
explicit PartitionTable(Kernel::StorageDevice const&);
|
||||
|
||||
NonnullRefPtr<Kernel::StorageDevice> m_device;
|
||||
Vector<DiskPartitionMetadata> m_partitions;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue