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/Topology.h"
32 #include "storage/Devices/Device.h"
33 #include "storage/Devices/Partition.h"
43 PT_UNKNOWN, PT_LOOP, MSDOS, GPT, DASD, MAC
46 std::string get_pt_type_name(
PtType pt_type);
59 bool primary_possible;
61 bool extended_possible;
63 bool logical_possible;
90 unsigned int max_primary()
const;
91 bool extended_possible()
const;
92 unsigned int max_logical()
const;
94 unsigned int num_primary()
const;
95 bool has_extended()
const;
96 unsigned int num_logical()
const;
108 Partition* get_partition(
const std::string& name);
112 std::vector<PartitionSlot> get_unused_partition_slots(AlignPolicy align_policy = AlignPolicy::KEEP_END)
const;
117 Region align(
const Region& region, AlignPolicy align_policy = AlignPolicy::ALIGN_END)
const;
124 const Impl& get_impl()
const;
133 bool is_partition_table(
const Device* device);
PartitionType
Partition type (primary, extended, logical)
Definition: Partition.h:39
A start/length pair with a block size.
Definition: Region.h:71
std::vector< Partition * > get_partitions()
Sorted by partition number.
PtType
Partition Table Type.
Definition: PartitionTable.h:42
Region align(const Region ®ion, AlignPolicy align_policy=AlignPolicy::ALIGN_END) const
region is sector-based.
An abstract base class of storage devices, and a vertex in the Devicegraph.
Definition: Device.h:73
Definition: Partitionable.h:40
Partition * create_partition(const std::string &name, const Region ®ion, PartitionType type)
region is sector-based.
A partition of a Partitionable, e.g. Disk or Md.
Definition: Partition.h:107
The storage namespace.
Definition: Actiongraph.h:36
Definition: PartitionTable.h:71
Definition: PartitionTable.h:49
void delete_partition(Partition *partition)
Delete a partition in the partition table.