23 #ifndef STORAGE_PARTITION_TABLE_H 24 #define STORAGE_PARTITION_TABLE_H 29 #include "storage/Utils/Swig.h" 30 #include "storage/Utils/Region.h" 31 #include "storage/Utils/Alignment.h" 32 #include "storage/Devices/Device.h" 33 #include "storage/Devices/Partition.h" 43 UNKNOWN, LOOP, MSDOS, GPT, DASD, MAC, IMPLICIT
46 std::string get_pt_type_name(
PtType pt_type);
61 unsigned nr()
const ST_DEPRECATED {
return number; }
66 bool primary_possible;
68 bool extended_possible;
70 bool logical_possible;
74 friend std::ostream& operator<<(std::ostream& s,
const PartitionSlot& partition_slot);
129 unsigned int num_primary()
const;
130 bool has_extended()
const;
131 unsigned int num_logical()
const;
199 const Impl& get_impl()
const;
208 bool is_partition_table(
const Device* device);
Region align(const Region ®ion, AlignPolicy align_policy=AlignPolicy::ALIGN_START_AND_END, AlignType align_type=AlignType::OPTIMAL) const
region is sector-based.
bool extended_possible() const
Returns whether a extended partition is supported.
std::vector< PartitionSlot > get_unused_partition_slots(AlignPolicy align_policy=AlignPolicy::ALIGN_START_KEEP_END, AlignType align_type=AlignType::OPTIMAL) const
const Partition * get_extended() const
Returns the extended partition of the partition table.
const Partitionable * get_partitionable() const
PartitionType
Partition type (primary, extended, logical)
Definition: Partition.h:39
PartitionTable * to_partition_table(Device *device)
Converts pointer to Device to pointer to PartitionTable.
unsigned int max_primary() const
Highest number for a primary or extended partition.
A start/length pair with a block size.
Definition: Region.h:73
bool is_partition_legacy_boot_flag_supported() const
Returns whether the legacy boot flag is supported on partitions on the partition table.
AlignPolicy
Definition: Alignment.h:50
Partition * get_partition(const std::string &name)
std::vector< Partition * > get_partitions()
Get partitions of the partition table.
PtType
Partition Table Type.
Definition: PartitionTable.h:42
A class to calculate partition alignment based on hardware topology.
Definition: Alignment.h:91
Align start and keep end.
An abstract base class of storage devices, and a vertex in the Devicegraph.
Definition: Device.h:75
Definition: Partitionable.h:40
unsigned int max_logical() const
Highest number for a logical partition.
bool is_partition_id_supported(unsigned int id) const
Returns whether the partition id is supported on the partition table.
Partition * create_partition(const std::string &name, const Region ®ion, PartitionType type)
region is sector-based.
bool is_partition_boot_flag_supported() const
Returns whether the boot flag is supported on partitions on the partition table.
AlignType
Definition: Alignment.h:36
Align to topology information.
A partition of a Partitionable, e.g. Disk or Md.
Definition: Partition.h:114
The storage namespace.
Definition: Actiongraph.h:37
Definition: PartitionTable.h:81
Number and name are only valid if one of the possible flags is true.
Definition: PartitionTable.h:52
void delete_partition(Partition *partition)
Delete a partition in the partition table.