#include <Partition.h>

Public Types | |
| enum | IdNum { ID_DOS16 = 0x6, ID_DOS = 0x0c, ID_NTFS = 0x07, ID_EXTENDED = 0x0f, ID_LINUX = 0x83, ID_SWAP = 0x82, ID_LVM = 0x8e, ID_RAID = 0xfd, ID_APPLE_OTHER = 0x101, ID_APPLE_HFS = 0x102, ID_GPT_BOOT = 0x103, ID_GPT_SERVICE = 0x104, ID_GPT_MSFTRES = 0x105, ID_APPLE_UFS = 0x106 } |
Public Member Functions | |
| Partition (const Disk &d, unsigned Pnr, unsigned long long SizeK, unsigned long Start, unsigned long CSize, storage::PartitionType Type, unsigned id=ID_LINUX, bool Boot=false) | |
| Partition (const Disk &d, const string &Data) | |
| Partition (const Disk &d, const Partition &p) | |
| virtual | ~Partition () |
| unsigned long | cylStart () const |
| unsigned long | cylSize () const |
| unsigned long | cylEnd () const |
| const Region & | region () const |
| const std::list< string > | udevId () const |
| const string & | udevPath () const |
| string | sysfsPath () const |
| bool | intersectArea (const Region &r, unsigned fuzz=0) const |
| bool | contains (const Region &r, unsigned fuzz=0) const |
| unsigned | OrigNr () const |
| bool | boot () const |
| unsigned | id () const |
| storage::PartitionType | type () const |
| std::ostream & | logData (std::ostream &file) const |
| void | changeRegion (unsigned long Start, unsigned long CSize, unsigned long long SizeK) |
| void | changeNumber (unsigned new_num) |
| void | changeId (unsigned id) |
| void | changeIdDone () |
| void | unChangeId () |
| string | removeText (bool doing=true) const |
| string | createText (bool doing=true) const |
| string | formatText (bool doing=true) const |
| string | resizeText (bool doing=true) const |
| void | getCommitActions (std::list< storage::commitAction * > &l) const |
| string | setTypeText (bool doing=true) const |
| int | setFormat (bool format=true, storage::FsType fs=storage::REISERFS) |
| int | changeMount (const string &val) |
| const Disk * | disk () const |
| bool | isWindows () const |
| virtual void | print (std::ostream &s) const |
| void | setResizedSize (unsigned long long SizeK) |
| void | forgetResize () |
| bool | canUseDevice () const |
| void | getInfo (storage::PartitionInfo &info) const |
| void | getInfo (storage::PartitionAddInfo &info) const |
| bool | equalContent (const Partition &rhs) const |
| void | logDifference (const Partition &d) const |
| void | addUdevData () |
| bool | operator== (const Partition &rhs) const |
| bool | operator!= (const Partition &rhs) const |
| bool | operator< (const Partition &rhs) const |
| bool | operator<= (const Partition &rhs) const |
| bool | operator>= (const Partition &rhs) const |
| bool | operator> (const Partition &rhs) const |
Static Public Member Functions | |
| static bool | notDeleted (const Partition &d) |
| static bool | toChangeId (const Partition &d) |
Protected Member Functions | |
| Partition & | operator= (const Partition &) |
| void | addAltUdevId (unsigned num) |
| void | addAltUdevPath (unsigned num) |
Protected Attributes | |
| Region | reg |
| bool | bootflag |
| storage::PartitionType | typ |
| unsigned | idt |
| unsigned | orig_id |
| string | parted_start |
| unsigned | orig_num |
| storage::PartitionInfo | info |
Static Protected Attributes | |
| static string | pt_names [storage::PTYPE_ANY+1] = { "primary", "extended", "logical", "any" } |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const Partition &p) |
| Partition::Partition | ( | const Disk & | d, | |
| unsigned | Pnr, | |||
| unsigned long long | SizeK, | |||
| unsigned long | Start, | |||
| unsigned long | CSize, | |||
| storage::PartitionType | Type, | |||
| unsigned | id = ID_LINUX, |
|||
| bool | Boot = false | |||
| ) |
References addUdevData(), bootflag, storage::Volume::cont, storage::Volume::dev, idt, storage::Container::name(), storage::Volume::num, orig_id, orig_num, typ, and y2debug.
| Partition::Partition | ( | const Disk & | d, | |
| const string & | Data | |||
| ) |
References addUdevData(), bootflag, storage::Volume::cont, storage::Volume::dev, storage::EXTENDED, idt, storage::LOGICAL, storage::Volume::mjr, storage::Volume::mnr, storage::Container::name(), storage::Volume::nm, storage::Volume::num, orig_id, orig_num, storage::Volume::orig_size_k, storage::PRIMARY, reg, storage::Volume::size_k, typ, storage::undevDevice(), and y2debug.
References storage::Volume::dev, and y2debug.
| Partition::~Partition | ( | ) | [virtual] |
References storage::Volume::dev, and y2debug.
| unsigned long storage::Partition::cylStart | ( | ) | const [inline] |
References reg, and storage::Region::start().
Referenced by storage::Disk::doCreate(), forgetResize(), getInfo(), storage::Disk::getPartedSectors(), storage::Disk::getPartitionAfter(), storage::Disk::resizePartition(), and setResizedSize().
| unsigned long storage::Partition::cylSize | ( | ) | const [inline] |
References storage::Region::len(), and reg.
Referenced by storage::Disk::doCreate(), getInfo(), and storage::Disk::resizePartition().
| unsigned long storage::Partition::cylEnd | ( | ) | const [inline] |
References storage::Region::len(), reg, and storage::Region::start().
Referenced by storage::Disk::getPartedSectors(), and storage::Disk::resizePartition().
| const list< string > Partition::udevId | ( | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::Volume::alt_names.
Referenced by addAltUdevId(), and getInfo().
| const string & Partition::udevPath | ( | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::Volume::alt_names, and storage::Volume::empty_string.
Referenced by addAltUdevPath(), and getInfo().
| string Partition::sysfsPath | ( | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::Volume::dev, disk(), storage::Disk::sysfsDir(), storage::undevDevice(), and y2mil.
| bool Partition::intersectArea | ( | const Region & | r, | |
| unsigned | fuzz = 0 | |||
| ) | const |
References storage::Region::intersect(), storage::Region::len(), and reg.
| bool Partition::contains | ( | const Region & | r, | |
| unsigned | fuzz = 0 | |||
| ) | const |
References storage::Region::intersect(), storage::Region::len(), and reg.
| unsigned storage::Partition::OrigNr | ( | ) | const [inline] |
| bool storage::Partition::boot | ( | ) | const [inline] |
References bootflag.
| unsigned storage::Partition::id | ( | ) | const [inline] |
References idt.
Referenced by storage::Disk::bootSpecial(), storage::DmPartCo::doCreate(), storage::Disk::doCreate(), isBsdPart(), and setTypeText().
| storage::PartitionType storage::Partition::type | ( | ) | const [inline] |
References typ.
Referenced by canUseDevice(), storage::Disk::checkPartedOutput(), storage::Dmraid::createText(), storage::DmPartCo::doCreate(), storage::Disk::doCreate(), storage::Disk::doResize(), storage::Storage::evmsActivate(), existingLog(), existingNotLog(), getInfo(), storage::Disk::getPartedValues(), storage::Disk::getPartitionAfter(), storage::Storage::handleEvmsRemoveDevice(), isExtended(), logicalCreated(), notCreatedPrimary(), notDeletedLog(), notDeletedNotLog(), and storage::Disk::resizePartition().
| std::ostream& storage::Partition::logData | ( | std::ostream & | file | ) | const |
| void Partition::changeRegion | ( | unsigned long | Start, | |
| unsigned long | CSize, | |||
| unsigned long long | SizeK | |||
| ) |
References storage::Volume::orig_size_k, reg, and storage::Volume::size_k.
Referenced by storage::Disk::getPartedValues(), and storage::Disk::resizePartition().
| void Partition::changeNumber | ( | unsigned | new_num | ) |
References addAltUdevId(), storage::Volume::alt_names, storage::Storage::changeDeviceName(), storage::Volume::created(), storage::Volume::dev, disk(), storage::Volume::getContainer(), storage::Volume::getMajorMinor(), storage::Container::getStorage(), storage::Volume::mjr, storage::Volume::mnr, storage::Volume::nm, storage::Volume::num, orig_num, storage::Volume::setNameDev(), udevCompletePathPath(), and storage::Disk::udevPath().
| void Partition::changeId | ( | unsigned | id | ) |
References storage::Volume::created(), idt, and orig_id.
| string Partition::removeText | ( | bool | doing = true |
) | const [virtual] |
Reimplemented from storage::Volume.
References storage::_(), storage::Volume::dev, disk(), storage::Disk::getPartName(), isWindows(), storage::Volume::num, storage::sformat(), storage::Volume::sizeK(), and storage::Volume::sizeString().
Referenced by storage::Disk::doRemove().
| string Partition::createText | ( | bool | doing = true |
) | const [virtual] |
Reimplemented from storage::Volume.
References storage::_(), storage::Volume::bootMount(), storage::Volume::dev, storage::ENC_NONE, storage::Volume::encryption, storage::EXTENDED, storage::Volume::fsTypeString(), ID_LINUX, ID_SWAP, idt, storage::Volume::mp, storage::sformat(), storage::Volume::sizeString(), and typ.
Referenced by storage::Disk::doCreate().
| string Partition::formatText | ( | bool | doing = true |
) | const [virtual] |
Reimplemented from storage::Volume.
References storage::_(), storage::Volume::dev, storage::ENC_NONE, storage::Volume::encryption, storage::Volume::fsTypeString(), storage::Volume::mp, storage::sformat(), and storage::Volume::sizeString().
| string Partition::resizeText | ( | bool | doing = true |
) | const [virtual] |
Reimplemented from storage::Volume.
References storage::_(), storage::Volume::dev, isWindows(), storage::Volume::needShrink(), storage::sformat(), and storage::Volume::sizeString().
Referenced by storage::Disk::doResize().
| void storage::Partition::getCommitActions | ( | std::list< storage::commitAction * > & | l | ) | const [virtual] |
Reimplemented from storage::Volume.
| string Partition::setTypeText | ( | bool | doing = true |
) | const |
References storage::_(), storage::Volume::dev, id(), and storage::sformat().
| int Partition::setFormat | ( | bool | format = true, |
|
| storage::FsType | fs = storage::REISERFS | |||
| ) | [virtual] |
Reimplemented from storage::Volume.
References storage::Volume::dev, storage::EXTENDED, storage::Volume::fs_names, storage::Volume::setFormat(), typ, storage::VOLUME_FORMAT_EXTENDED_UNSUPPORTED, and y2milestone.
| int Partition::changeMount | ( | const string & | val | ) | [virtual] |
Reimplemented from storage::Volume.
References storage::Volume::changeMount(), storage::Volume::dev, storage::EXTENDED, typ, storage::VOLUME_MOUNT_EXTENDED_UNSUPPORTED, and y2milestone.
| const Disk * Partition::disk | ( | ) | const |
References storage::Volume::cont.
Referenced by addAltUdevId(), addAltUdevPath(), changeNumber(), storage::Storage::evmsActivate(), forgetResize(), storage::Storage::handleEvmsRemoveDevice(), removeText(), setResizedSize(), and sysfsPath().
| bool Partition::isWindows | ( | ) | const |
| static bool storage::Partition::notDeleted | ( | const Partition & | d | ) | [inline, static] |
| static bool storage::Partition::toChangeId | ( | const Partition & | d | ) | [inline, static] |
References storage::Volume::deleted(), idt, and orig_id.
Referenced by storage::DmPartCo::commitChanges(), and storage::Disk::commitChanges().
| virtual void storage::Partition::print | ( | std::ostream & | s | ) | const [inline, virtual] |
Reimplemented from storage::Volume.
| void Partition::setResizedSize | ( | unsigned long long | SizeK | ) | [virtual] |
Reimplemented from storage::Volume.
References cylStart(), disk(), reg, and storage::Volume::setResizedSize().
Referenced by storage::Disk::resizePartition().
| void Partition::forgetResize | ( | ) | [virtual] |
Reimplemented from storage::Volume.
References cylStart(), disk(), storage::Volume::forgetResize(), reg, and storage::Volume::size_k.
| bool Partition::canUseDevice | ( | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::Volume::canUseDevice(), storage::EXTENDED, and type().
| void Partition::getInfo | ( | storage::PartitionInfo & | info | ) | const |
| void Partition::getInfo | ( | storage::PartitionAddInfo & | info | ) | const |
References storage::PartitionAddInfo::boot, bootflag, cylSize(), storage::PartitionAddInfo::cylSize, cylStart(), storage::PartitionAddInfo::cylStart, storage::PartitionAddInfo::id, idt, storage::mergeString(), storage::PartitionAddInfo::nr, storage::Volume::num, storage::PartitionAddInfo::partitionType, type(), storage::PartitionAddInfo::udevId, udevId(), storage::PartitionAddInfo::udevPath, and udevPath().
| bool Partition::equalContent | ( | const Partition & | rhs | ) | const |
References bootflag, storage::Volume::equalContent(), idt, reg, and typ.
| void Partition::logDifference | ( | const Partition & | d | ) | const |
| void Partition::addUdevData | ( | ) |
| bool Partition::operator== | ( | const Partition & | rhs | ) | const |
References storage::Volume::del, storage::Volume::num, and orig_num.
| bool storage::Partition::operator!= | ( | const Partition & | rhs | ) | const [inline] |
| bool Partition::operator< | ( | const Partition & | rhs | ) | const |
References storage::Volume::del, and orig_num.
| bool storage::Partition::operator<= | ( | const Partition & | rhs | ) | const [inline] |
| bool storage::Partition::operator>= | ( | const Partition & | rhs | ) | const [inline] |
| bool storage::Partition::operator> | ( | const Partition & | rhs | ) | const [inline] |
| void Partition::addAltUdevId | ( | unsigned | num | ) | [protected] |
References storage::Volume::alt_names, disk(), udevCompleteIdPath(), udevId(), and storage::Disk::udevId().
Referenced by addUdevData(), and changeNumber().
| void Partition::addAltUdevPath | ( | unsigned | num | ) | [protected] |
References storage::Volume::alt_names, disk(), udevCompletePathPath(), and udevPath().
Referenced by addUdevData().
| std::ostream& operator<< | ( | std::ostream & | s, | |
| const Partition & | p | |||
| ) | [friend] |
Region storage::Partition::reg [protected] |
Referenced by changeRegion(), contains(), cylEnd(), cylSize(), cylStart(), equalContent(), forgetResize(), intersectArea(), logDifference(), storage::operator<<(), operator=(), Partition(), region(), and setResizedSize().
bool storage::Partition::bootflag [protected] |
Referenced by boot(), equalContent(), getInfo(), logDifference(), storage::operator<<(), operator=(), and Partition().
storage::PartitionType storage::Partition::typ [protected] |
Referenced by changeMount(), createText(), equalContent(), logDifference(), storage::operator<<(), operator=(), Partition(), setFormat(), and type().
unsigned storage::Partition::idt [protected] |
Referenced by changeId(), changeIdDone(), createText(), equalContent(), getInfo(), id(), isWindows(), logDifference(), storage::operator<<(), operator=(), Partition(), toChangeId(), and unChangeId().
unsigned storage::Partition::orig_id [protected] |
Referenced by changeId(), changeIdDone(), logDifference(), storage::operator<<(), operator=(), Partition(), toChangeId(), and unChangeId().
string storage::Partition::parted_start [protected] |
unsigned storage::Partition::orig_num [protected] |
Referenced by changeNumber(), logDifference(), operator<(), storage::operator<<(), operator=(), operator==(), OrigNr(), and Partition().
string Partition::pt_names = { "primary", "extended", "logical", "any" } [static, protected] |
Referenced by logDifference(), and storage::operator<<().
storage::PartitionInfo storage::Partition::info [mutable, protected] |
1.5.5