#include <Partition.h>

Public Types | |
| enum | IdNum { ID_DOS12 = 0x01, ID_DOS16 = 0x06, ID_DOS32 = 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 &c, const string &name, const string &device, unsigned Pnr, unsigned long long SizeK, const Region &cylRegion, PartitionType Type, unsigned id=ID_LINUX, bool Boot=false) | |
| Partition (const Disk &c, const string &name, const string &device, unsigned Pnr, SystemInfo &systeminfo, unsigned long long SizeK, const Region &cylRegion, PartitionType Type, unsigned id=ID_LINUX, bool Boot=false) | |
| Partition (const Disk &c, const xmlNode *node) | |
| Partition (const Disk &c, const Partition &v) | |
| virtual | ~Partition () |
| void | saveData (xmlNode *node) const |
| unsigned long | cylStart () const |
| unsigned long | cylSize () const |
| unsigned long | cylEnd () const |
| const Region & | cylRegion () const |
| virtual string | udevPath () const |
| virtual list< string > | udevId () const |
| virtual string | procName () const |
| virtual 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 |
| void | changeRegion (const Region &cylRegion, unsigned long long SizeK) |
| void | changeNumber (unsigned new_num) |
| int | changeId (unsigned id) |
| void | changeIdDone () |
| void | unChangeId () |
| Text | removeText (bool doing) const |
| Text | createText (bool doing) const |
| Text | formatText (bool doing) const |
| Text | resizeText (bool doing) const |
| void | getCommitActions (list< commitAction > &l) const |
| Text | setTypeText (bool doing) 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 |
| Region | detectSysfsBlkRegion (bool log_error=true) const |
| void | getInfo (storage::PartitionInfo &info) const |
| void | getInfo (storage::PartitionAddInfo &info) const |
| bool | equalContent (const Partition &rhs) const |
| void | logDifference (std::ostream &log, const Partition &rhs) const |
| void | addUdevData () |
| int | zeroIfNeeded () 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 |
| bool | operator> (const Partition &rhs) const |
| virtual list< string > | getUsing () const |
Static Public Member Functions | |
| static bool | notDeleted (const Partition &d) |
| static bool | toChangeId (const Partition &d) |
Protected Member Functions | |
| void | addAltUdevId (unsigned num) |
| void | addAltUdevPath (unsigned num) |
Protected Attributes | |
| Region | reg |
| bool | bootflag |
| storage::PartitionType | typ |
| unsigned | idt |
| unsigned | orig_id |
| unsigned | orig_num |
| storage::PartitionInfo | info |
Private Member Functions | |
| Partition (const Partition &) | |
| Partition & | operator= (const Partition &) |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const Partition &p) |
| storage::Partition::Partition | ( | const Disk & | c, | |
| const string & | name, | |||
| const string & | device, | |||
| unsigned | Pnr, | |||
| unsigned long long | SizeK, | |||
| const Region & | cylRegion, | |||
| PartitionType | Type, | |||
| unsigned | id = ID_LINUX, |
|||
| bool | Boot = false | |||
| ) |
| storage::Partition::Partition | ( | const Disk & | c, | |
| const string & | name, | |||
| const string & | device, | |||
| unsigned | Pnr, | |||
| SystemInfo & | systeminfo, | |||
| unsigned long long | SizeK, | |||
| const Region & | cylRegion, | |||
| PartitionType | Type, | |||
| unsigned | id = ID_LINUX, |
|||
| bool | Boot = false | |||
| ) |
| storage::Partition::Partition | ( | const Disk & | c, | |
| const xmlNode * | node | |||
| ) |
References storage::Device::dev, and y2deb.
| storage::Partition::~Partition | ( | ) | [virtual] |
References storage::Device::dev, and y2deb.
| storage::Partition::Partition | ( | const Partition & | ) | [private] |
| void storage::Partition::saveData | ( | xmlNode * | node | ) | const |
Reimplemented from storage::Volume.
References bootflag, idt, reg, storage::Volume::saveData(), storage::setChildValue(), storage::toString(), and typ.
| unsigned long storage::Partition::cylStart | ( | ) | const [inline] |
| unsigned long storage::Partition::cylSize | ( | ) | const [inline] |
References storage::Region::len(), and reg.
Referenced by storage::Disk::doCreate(), storage::Disk::freeCylindersAroundPartition(), getInfo(), and storage::Disk::resizePartition().
| unsigned long storage::Partition::cylEnd | ( | ) | const [inline] |
References storage::Region::end(), and reg.
Referenced by storage::Disk::freeCylindersAroundPartition(), and storage::Disk::getPartedSectors().
| string storage::Partition::udevPath | ( | ) | const [virtual] |
Reimplemented from storage::Device.
References disk(), storage::Volume::num, storage::udevAppendPart(), and storage::Disk::udevPath().
| list< string > storage::Partition::udevId | ( | ) | const [virtual] |
Reimplemented from storage::Device.
References disk(), storage::Volume::num, storage::udevAppendPart(), and storage::Disk::udevId().
| virtual string storage::Partition::procName | ( | ) | const [inline, virtual] |
Reimplemented from storage::Device.
References storage::Device::nm.
Referenced by storage::Disk::addPartition(), storage::Disk::getPartedValues(), and sysfsPath().
| string storage::Partition::sysfsPath | ( | ) | const [virtual] |
Reimplemented from storage::Device.
References disk(), procName(), and storage::Disk::sysfsPath().
Referenced by detectSysfsBlkRegion().
| bool storage::Partition::intersectArea | ( | const Region & | r, | |
| unsigned | fuzz = 0 | |||
| ) | const |
References storage::Region::intersect(), storage::Region::len(), and reg.
| bool storage::Partition::contains | ( | const Region & | r, | |
| unsigned | fuzz = 0 | |||
| ) | const |
References storage::Region::intersect(), storage::Region::len(), and reg.
| unsigned storage::Partition::OrigNr | ( | ) | const [inline] |
References orig_num.
Referenced by storage::Disk::doRemove(), storage::Dmraid::removeText(), and storage::Dmmultipath::removeText().
| bool storage::Partition::boot | ( | ) | const [inline] |
References bootflag.
| unsigned storage::Partition::id | ( | ) | const [inline] |
References idt.
Referenced by storage::MdPartCo::doCreate(), storage::DmPartCo::doCreate(), storage::Disk::doCreate(), and setTypeText().
| storage::PartitionType storage::Partition::type | ( | ) | const [inline] |
References typ.
Referenced by canUseDevice(), storage::Disk::checkPartitionsValid(), storage::Dmraid::createText(), storage::Dmmultipath::createText(), storage::MdPartCo::doCreate(), storage::DmPartCo::doCreate(), storage::Disk::doCreate(), storage::Disk::doResize(), storage::existingLog(), storage::existingNotLog(), storage::Disk::freeCylindersAroundPartition(), getInfo(), storage::Disk::getPartedValues(), storage::Disk::getPartitionAfter(), storage::Storage::getRecursiveUsingHelper(), storage::logicalCreated(), storage::notCreatedPrimary(), storage::notDeletedExt(), storage::notDeletedLog(), storage::notDeletedNotLog(), storage::notDeletedPri(), and storage::MdPart::updateSize().
| void storage::Partition::changeRegion | ( | const Region & | cylRegion, | |
| unsigned long long | SizeK | |||
| ) |
References storage::Volume::orig_size_k, reg, and storage::Device::size_k.
Referenced by storage::Disk::getPartedValues(), and storage::Disk::resizePartition().
| void storage::Partition::changeNumber | ( | unsigned | new_num | ) |
| int storage::Partition::changeId | ( | unsigned | id | ) |
References storage::Device::created(), storage::DISK_INVALID_PARTITION_ID, idt, orig_id, and y2mil.
| Text storage::Partition::removeText | ( | bool | doing | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::_(), storage::Device::dev, disk(), storage::Disk::getPartDevice(), isWindows(), storage::Volume::num, orig_num, storage::sformat(), storage::Device::sizeK(), and storage::Device::sizeString().
Referenced by storage::Disk::doRemove().
| Text storage::Partition::createText | ( | bool | doing | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::_(), storage::Volume::createText(), storage::Device::dev, storage::EXTENDED, storage::sformat(), storage::Device::sizeString(), and typ.
Referenced by storage::Disk::doCreate().
| Text storage::Partition::formatText | ( | bool | doing | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::_(), storage::Device::dev, storage::ENC_NONE, storage::Volume::encryption, storage::Volume::fsTypeString(), storage::Volume::mp, storage::sformat(), and storage::Device::sizeString().
| Text storage::Partition::resizeText | ( | bool | doing | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::_(), storage::Device::dev, isWindows(), storage::Volume::needShrink(), storage::sformat(), and storage::Device::sizeString().
Referenced by storage::Disk::doResize().
| void storage::Partition::getCommitActions | ( | list< commitAction > & | l | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::Volume::cont, storage::Volume::getCommitActions(), idt, storage::INCREASE, orig_id, setTypeText(), and storage::Container::type().
| Text storage::Partition::setTypeText | ( | bool | doing | ) | const |
References storage::_(), storage::Device::dev, id(), and storage::sformat().
Referenced by getCommitActions().
| int storage::Partition::setFormat | ( | bool | format = true, |
|
| storage::FsType | fs = storage::REISERFS | |||
| ) | [virtual] |
Reimplemented from storage::Volume.
References storage::Device::dev, storage::EXTENDED, storage::Volume::setFormat(), storage::toString(), typ, storage::VOLUME_FORMAT_EXTENDED_UNSUPPORTED, and y2mil.
| int storage::Partition::changeMount | ( | const string & | val | ) | [virtual] |
Reimplemented from storage::Volume.
References storage::Volume::changeMount(), storage::Device::dev, storage::EXTENDED, typ, storage::VOLUME_MOUNT_EXTENDED_UNSUPPORTED, and y2mil.
| const Disk * storage::Partition::disk | ( | ) | const |
References storage::Volume::cont.
Referenced by addAltUdevId(), addAltUdevPath(), changeNumber(), forgetResize(), storage::Storage::getRecursiveUsingHelper(), removeText(), setResizedSize(), sysfsPath(), udevId(), and udevPath().
| bool storage::Partition::isWindows | ( | ) | const |
References ID_DOS12, ID_DOS16, ID_DOS32, ID_NTFS, and idt.
Referenced by removeText(), and resizeText().
| static bool storage::Partition::notDeleted | ( | const Partition & | d | ) | [inline, static] |
References storage::Device::deleted().
Referenced by storage::Disk::availablePartNumber(), storage::Disk::changePartitionArea(), storage::Disk::changePartitionId(), storage::Disk::createChecks(), storage::Dasd::doFdasd(), storage::Disk::forgetChangePartitionId(), storage::Disk::freeCylindersAroundPartition(), storage::Disk::getPartitionAfter(), storage::Storage::getPartitionInfo(), storage::Storage::getRecursiveUsingHelper(), storage::MdPartCo::handleWholeDevice(), storage::DmPartCo::handleWholeDevice(), storage::Disk::numPartitions(), storage::Disk::removePartition(), and storage::Dasd::removePartition().
| static bool storage::Partition::toChangeId | ( | const Partition & | d | ) | [inline, static] |
References storage::Device::deleted(), idt, and orig_id.
Referenced by storage::MdPartCo::commitChanges(), storage::DmPartCo::commitChanges(), storage::Disk::commitChanges(), and storage::Disk::getToCommit().
| virtual void storage::Partition::print | ( | std::ostream & | s | ) | const [inline, virtual] |
Reimplemented from storage::Volume.
| void storage::Partition::setResizedSize | ( | unsigned long long | SizeK | ) | [virtual] |
Reimplemented from storage::Volume.
References disk(), reg, storage::Region::setLen(), and storage::Volume::setResizedSize().
Referenced by storage::Disk::resizePartition().
| void storage::Partition::forgetResize | ( | ) | [virtual] |
Reimplemented from storage::Volume.
References disk(), storage::Volume::forgetResize(), reg, storage::Region::setLen(), and storage::Device::size_k.
| bool storage::Partition::canUseDevice | ( | ) | const [virtual] |
Reimplemented from storage::Volume.
References storage::Volume::canUseDevice(), storage::EXTENDED, and type().
| Region storage::Partition::detectSysfsBlkRegion | ( | bool | log_error = true |
) | const |
References storage::read_sysfs_property(), and sysfsPath().
Referenced by storage::Disk::checkPartitionsValid(), storage::Dasd::checkPartitionsValid(), and storage::Disk::getPartedValues().
| void storage::Partition::getInfo | ( | storage::PartitionInfo & | info | ) | const |
References storage::Volume::getInfo(), info, and storage::PartitionInfo::v.
Referenced by storage::MdPart::getInfo(), and storage::DmPart::getInfo().
| void storage::Partition::getInfo | ( | storage::PartitionAddInfo & | info | ) | const |
| bool storage::Partition::equalContent | ( | const Partition & | rhs | ) | const |
References bootflag, storage::Volume::equalContent(), idt, reg, and typ.
| void storage::Partition::logDifference | ( | std::ostream & | log, | |
| const Partition & | rhs | |||
| ) | const |
References bootflag, idt, storage::logDiff(), storage::logDiffEnum(), storage::Volume::logDifference(), storage::logDiffHex(), orig_id, orig_num, reg, and typ.
| void storage::Partition::addUdevData | ( | ) |
| int storage::Partition::zeroIfNeeded | ( | ) | const |
| bool storage::Partition::operator== | ( | const Partition & | rhs | ) | const |
| bool storage::Partition::operator!= | ( | const Partition & | rhs | ) | const [inline] |
| bool storage::Partition::operator< | ( | const Partition & | rhs | ) | const |
References storage::Volume::cont, storage::Device::del, storage::Volume::getContainer(), 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] |
| list< string > storage::Partition::getUsing | ( | ) | const [virtual] |
Reimplemented from storage::Device.
References storage::Volume::cont, and storage::Device::device().
| void storage::Partition::addAltUdevId | ( | unsigned | num | ) | [protected] |
References storage::Device::alt_names, disk(), storage::udevAppendPart(), and storage::Disk::udevId().
Referenced by addUdevData(), and changeNumber().
| void storage::Partition::addAltUdevPath | ( | unsigned | num | ) | [protected] |
References storage::Device::alt_names, disk(), storage::udevAppendPart(), and storage::Disk::udevPath().
Referenced by addUdevData(), and changeNumber().
| std::ostream& operator<< | ( | std::ostream & | s, | |
| const Partition & | p | |||
| ) | [friend] |
Region storage::Partition::reg [protected] |
Referenced by changeRegion(), contains(), cylEnd(), cylRegion(), cylSize(), cylStart(), equalContent(), forgetResize(), intersectArea(), logDifference(), storage::operator<<(), Partition(), saveData(), and setResizedSize().
bool storage::Partition::bootflag [protected] |
Referenced by boot(), equalContent(), getInfo(), logDifference(), storage::operator<<(), Partition(), and saveData().
storage::PartitionType storage::Partition::typ [protected] |
Referenced by changeMount(), createText(), equalContent(), logDifference(), storage::operator<<(), Partition(), saveData(), setFormat(), and type().
unsigned storage::Partition::idt [protected] |
Referenced by changeId(), changeIdDone(), equalContent(), getCommitActions(), getInfo(), id(), isWindows(), logDifference(), storage::operator<<(), Partition(), saveData(), toChangeId(), and unChangeId().
unsigned storage::Partition::orig_id [protected] |
Referenced by changeId(), changeIdDone(), getCommitActions(), logDifference(), storage::operator<<(), Partition(), toChangeId(), and unChangeId().
unsigned storage::Partition::orig_num [protected] |
Referenced by changeNumber(), logDifference(), operator<(), storage::operator<<(), operator==(), OrigNr(), Partition(), and removeText().
storage::PartitionInfo storage::Partition::info [mutable, protected] |
1.5.6