本文整理汇总了C++中Sector::setReadError方法的典型用法代码示例。如果您正苦于以下问题:C++ Sector::setReadError方法的具体用法?C++ Sector::setReadError怎么用?C++ Sector::setReadError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sector
的用法示例。
在下文中一共展示了Sector::setReadError方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
return (false);
}
debugss(ssFloppyDisk, ALL, "Sector Size: %d (%d)\n", sectorSize,
sectorSizeKey);
for (int i = 0; i < numSec; i++)
{
sectorOrder[i] = buf[pos++];
}
if (sectorCylMap)
{
debugss(ssFloppyDisk, INFO, "Sector Cylinder Map Present\n");
for (int i = 0; i < numSec; i++)
{
sectorCylMapping[i] = buf[pos++];
}
}
if (sectorHeadMap)
{
debugss(ssFloppyDisk, INFO, "Sector Head Map Present\n");
for (int i = 0; i < numSec; i++)
{
sectorHeadMapping[i] = buf[pos++];
}
}
for (int i = 0; i < numSec; i++)
{
unsigned char sectorType = buf[pos++];
debugss(ssFloppyDisk, INFO, "Sector: %d(%d) Type: %d\n", sectorOrder[i], i, sectorType);
if (sectorType == 0x00)
{
// Sector Data Unavailable
debugss(ssFloppyDisk, INFO, "Sector Size unknown: %d\n", sectorSizeKey);
}
else if (sectorType > 0x08)
{
// Out of Range.
debugss(ssFloppyDisk, ERROR, "Out of Range: %d\n", sectorType);
delete [] buf;
return false;
}
else
{
BYTE type = sectorType - 1;
bool compressed = ((type & 0x01) != 0);
bool deleteData = ((type & 0x02) != 0);
bool dataError = ((type & 0x04) != 0);
BYTE sectorData[sectorSize];
if (compressed)
{
BYTE val = buf[pos++];
for (int i = 0; i < sectorSize; i++)
{
sectorData[i] = val;
}
}
else
{
for (int i = 0; i < sectorSize; i++)
{
sectorData[i] = buf[pos++];
}
}
// create sector
Sector* sect = new Sector(head, cyl, sectorOrder[i], sectorSize, sectorData);
// set flags
sect->setReadError(dataError);
sect->setDeletedDataAddressMark(deleteData);
// add sector to track
trk->addSector(sect);
}
}
// add track to disk
tracks_m[head].push_back(trk);
}
while (pos < fileSize);
delete [] buf;
debugss(ssFloppyDisk, INFO, "Read successful.\n");
return true;
}