| 53 | } |
| 54 | |
| 55 | void Image::addMissingSectors(const DiskLayout& diskLayout, bool populated) |
| 56 | { |
| 57 | for (auto& location : diskLayout.logicalSectorLocationsInFilesystemOrder) |
| 58 | if (!_sectors.contains(location)) |
| 59 | { |
| 60 | auto& ltl = diskLayout.layoutByLogicalLocation.at( |
| 61 | {location.logicalCylinder, location.logicalHead}); |
| 62 | auto sector = std::make_shared<Sector>(location); |
| 63 | |
| 64 | if (populated) |
| 65 | sector->data = Bytes(ltl->sectorSize); |
| 66 | else |
| 67 | sector->status = Sector::MISSING; |
| 68 | |
| 69 | _sectors[location] = sector; |
| 70 | } |
| 71 | calculateSize(); |
| 72 | } |
| 73 | |
| 74 | void Image::calculateSize() |
| 75 | { |