24 #ifndef STORAGE_PARTITION_H 25 #define STORAGE_PARTITION_H 28 #include "storage/Devices/BlkDevice.h" 192 unsigned int get_id()
const;
197 void set_id(
unsigned int id);
242 const std::string&
get_uuid()
const;
290 const Impl& get_impl()
const;
292 virtual Partition* clone()
const override;
Only for MS-DOS.
Definition: Partition.h:94
Partition * to_partition(Device *device)
Converts pointer to Device to pointer to Partition.
BIOS boot partition (https://en.wikipedia.org/wiki/BIOS_boot_partition), only for GPT...
Definition: Partition.h:131
Only set during probing.
Definition: Partition.h:127
For MS-DOS, GPT, DASD and implicit.
Definition: Partition.h:112
void set_type(PartitionType type)
Set the partiton type.
std::string get_partition_id_name(IdNum partition_id)
Convert the IdNum partition_id to a string.
For MS-DOS and GPT.
Definition: Partition.h:103
void set_legacy_boot(bool legacy_boot)
Set the legacy boot flag of the partition.
static bool compare_by_number(const Partition *lhs, const Partition *rhs)
Compare (less than) two Partitions by number.
Only for MS-DOS.
Definition: Partition.h:91
PartitionType
Enum with partition types.
Definition: Partition.h:41
Only for MS-DOS.
Definition: Partition.h:88
LVM partition, for MS-DOS, GPT and DASD.
Definition: Partition.h:118
std::string get_partition_type_name(PartitionType partition_type)
Convert the PartitionType partition_type to a string.
A start/length pair with a block size.
Definition: Region.h:73
Region get_unused_surrounding_region() const
Returns the unused region surrounding the partition (including the partition itself).
PPC PReP Boot partition, for MS-DOS and GPT.
Definition: Partition.h:106
Windows basic data partition, only for GPT.
Definition: Partition.h:134
bool is_partition(const Device *device)
Checks whether device points to a Partition.
Intel Rapid Start Technology, for MS-DOS and GPT.
Definition: Partition.h:115
EFI System Partition, for MS-DOS and GPT.
Definition: Partition.h:124
The main container of the libstorage-ng.
Definition: Devicegraph.h:169
Swap partition, for MS-DOS, GPT and DASD.
Definition: Partition.h:109
Only for MS-DOS.
Definition: Partition.h:97
const std::string & get_label() const
Get the partition label.
An abstract Block Device.
Definition: BlkDevice.h:46
unsigned int get_number() const
Get the partition number.
const PartitionTable * get_partition_table() const
Return the partition table the partition belongs to.
const std::string & get_uuid() const
Get the partition UUID.
void set_boot(bool boot)
Set the boot flag of the partition.
An abstract base class for storage devices.
Definition: Device.h:81
PartitionType get_type() const
Get the partition type.
const Partitionable * get_partitionable() const
Return the partitionable the partition belongs to.
Microsoft reserved partition, only for GPT.
Definition: Partition.h:137
Only for MS-DOS.
Definition: Partition.h:100
Definition: Partitionable.h:39
bool is_legacy_boot() const
Query the legacy boot flag of the partition.
A partition of a Partitionable, e.g.
Definition: Partition.h:155
RAID partition, for MS-DOS, GPT and DASD.
Definition: Partition.h:121
The storage namespace.
Definition: Actiongraph.h:38
static Partition * find_by_name(Devicegraph *devicegraph, const std::string &name)
Find a Partition by its name.
Definition: PartitionTable.h:87
bool is_boot() const
Query the boot flag of the partition.
IdNum
Enum with values used as partition ids.
Definition: Partition.h:85
static Partition * create(Devicegraph *devicegraph, const std::string &name, const Region ®ion, PartitionType type)
Create a device of type Partition.
void set_id(unsigned int id)