Lines Matching refs:partNum
1452 void GPTData::ShowPartDetails(uint32_t partNum) {
1453 if ((partNum < numParts) && !IsFreePartNum(partNum)) {
1454 partitions[partNum].ShowDetails(blockSize);
1456 cout << "Partition #" << partNum + 1 << " does not exist.\n";
1575 int GPTData::XFormDisklabel(uint32_t partNum) {
1584 if (partNum > high) {
1591 goOn = disklabel.ReadBSDData(&myDisk, partitions[partNum].GetFirstLBA(),
1592 partitions[partNum].GetLastLBA());
1604 partitions[partNum].BlankPartition();
1611 int i, partNum = 0, numDone = 0;
1615 partNum = FindFirstFreePart();
1616 if (partNum >= 0) {
1617 partitions[partNum] = disklabel->AsGPT(i);
1618 if (partitions[partNum].IsUsed())
1622 if (partNum == -1)
1757 int GPTData::DeletePartition(uint32_t partNum) {
1762 if ((numUsedParts > 0) && (partNum >= low) && (partNum <= high)) {
1765 startSector = partitions[partNum].GetFirstLBA();
1766 length = partitions[partNum].GetLengthLBA();
1770 partitions[partNum].BlankPartition();
1772 cerr << "Partition number " << partNum + 1 << " out of range!\n";
1776 } // GPTData::DeletePartition(uint32_t partNum)
1780 uint32_t GPTData::CreatePartition(uint32_t partNum, uint64_t startSector, uint64_t endSector) {
1784 if (IsFreePartNum(partNum)) {
1792 partitions[partNum].SetFirstLBA(startSector);
1793 partitions[partNum].SetLastLBA(endSector);
1794 partitions[partNum].SetType(DEFAULT_GPT_TYPE);
1795 partitions[partNum].RandomizeUniqueGUID();
1800 } // GPTData::CreatePartition(partNum, startSector, endSector)
1904 int GPTData::SetName(uint32_t partNum, const UnicodeString & theName) {
1907 if (IsUsedPartNum(partNum))
1908 partitions[partNum].SetName(theName);
1951 int GPTData::ChangePartType(uint32_t partNum, PartType theGUID) {
1954 if (!IsFreePartNum(partNum)) {
1955 partitions[partNum].SetType(theGUID);
2216 // in partNum, if that variable is non-NULL. (A value of UINT32_MAX is
2217 // returned in partNum if the sector is in use by basic GPT data structures.)
2218 int GPTData::IsFree(uint64_t sector, uint32_t *partNum) {
2226 if (partNum != NULL)
2227 *partNum = i;
2233 if (partNum != NULL)
2234 *partNum = UINT32_MAX;
2239 // Returns 1 if partNum is unused AND if it's a legal value.
2240 int GPTData::IsFreePartNum(uint32_t partNum) {
2241 return ((partNum < numParts) && (partitions != NULL) &&
2242 (!partitions[partNum].IsUsed()));
2245 // Returns 1 if partNum is in use.
2246 int GPTData::IsUsedPartNum(uint32_t partNum) {
2247 return ((partNum < numParts) && (partitions != NULL) &&
2248 (partitions[partNum].IsUsed()));
2338 bool GPTData::ValidPartNum (const uint32_t partNum) {
2339 if (partNum >= numParts) {
2340 cerr << "Partition number out of range: " << partNum << "\n";
2348 const GPTPart & GPTData::operator[](uint32_t partNum) const {
2349 if (partNum >= numParts) {
2350 cerr << "Partition number out of range (" << partNum << " requested, but only "
2358 return partitions[partNum];
2370 int GPTData::ManageAttributes(int partNum, const string & command, const string & bits) {
2374 if (partNum >= (int) numParts) {
2375 cerr << "Invalid partition number (" << partNum + 1 << ")\n";
2379 ShowAttributes(partNum);
2381 GetAttribute(partNum, bits);
2383 theAttr = partitions[partNum].GetAttributes();
2384 if (theAttr.OperateOnAttributes(partNum, command, bits)) {
2385 partitions[partNum].SetAttributes(theAttr.GetAttributes());
2397 void GPTData::ShowAttributes(const uint32_t partNum) {
2398 if ((partNum < numParts) && partitions[partNum].IsUsed())
2399 partitions[partNum].ShowAttributes(partNum);
2403 void GPTData::GetAttribute(const uint32_t partNum, const string& attributeBits) {
2404 if (partNum < numParts)
2405 partitions[partNum].GetAttributes().OperateOnAttributes(partNum, "get", attributeBits);