MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / addMissingSectors

Method addMissingSectors

lib/data/image.cc:55–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void 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
74void Image::calculateSize()
75{

Callers 2

discardChangesMethod · 0.80
TestSectorInterfaceMethod · 0.80

Calls 2

BytesClass · 0.50
containsMethod · 0.45

Tested by 1

TestSectorInterfaceMethod · 0.64