ladybird/Kernel/Storage/Partition/PartitionTable.h
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00

41 lines
924 B
C++

/*
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/RefPtr.h>
#include <AK/Vector.h>
#include <Kernel/Storage/Partition/DiskPartition.h>
#include <Kernel/Storage/Partition/DiskPartitionMetadata.h>
#include <Kernel/Storage/StorageDevice.h>
namespace Kernel {
class PartitionTable {
public:
enum class Error {
Invalid,
MBRProtective,
ConatinsEBR,
};
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(const StorageDevice&);
NonnullRefPtr<StorageDevice> m_device;
Vector<DiskPartitionMetadata> m_partitions;
};
}