mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 02:32:45 +00:00 
			
		
		
		
	 1682f0b760
			
		
	
	
		1682f0b760
		
	
	
	
	
		
			
			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 *
		
			
				
	
	
		
			40 lines
		
	
	
	
		
			924 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			40 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;
 | |
| };
 | |
| 
 | |
| }
 |