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

Method getLogicalSector

lib/vfs/vfs.cc:283–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283Bytes Filesystem::getLogicalSector(uint32_t number, uint32_t count)
284{
285 if ((number + count) > _blockCount)
286 throw BadFilesystemException(fmt::format(
287 "invalid filesystem: sector {} is out of bounds ({} maximum)",
288 number + count - 1,
289 _diskLayout->logicalSectorLocationsInFilesystemOrder.size()));
290
291 Bytes data;
292 ByteWriter bw(data);
293 for (int i = 0; i < count; i++)
294 {
295 auto& [cylinder, head, sectorId] =
296 _diskLayout->logicalSectorLocationsInFilesystemOrder.at(number + i);
297 auto& ltl = _diskLayout->layoutByLogicalLocation.at({cylinder, head});
298 bw += _sectors->get(cylinder, head, sectorId)
299 ->data.slice(0, ltl->sectorSize);
300 }
301 return data;
302}
303
304void Filesystem::putLogicalSector(uint32_t number, const Bytes& data)
305{

Callers 6

AcornDfsDirectoryMethod · 0.80
ZDosDescriptorMethod · 0.80
readRecordMethod · 0.80
MicrodosDirentMethod · 0.80
BrotherDirectoryMethod · 0.80
DirectoryMethod · 0.80

Calls 4

sliceMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected