本文整理汇总了C++中common::File::readSint32BE方法的典型用法代码示例。如果您正苦于以下问题:C++ File::readSint32BE方法的具体用法?C++ File::readSint32BE怎么用?C++ File::readSint32BE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::File
的用法示例。
在下文中一共展示了File::readSint32BE方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readVolCnf
int16 readVolCnf() {
int i;
Common::File fileHandle;
short int sizeHEntry;
volumeDataLoaded = 0;
for (i = 0; i < 20; i++) {
volumeData[i].ident[0] = 0;
volumeData[i].ptr = NULL;
volumeData[i].diskNumber = i + 1;
volumeData[i].size = 0;
}
fileHandle.open("VOL.CNF");
if (!fileHandle.isOpen()) {
return (0);
}
numOfDisks = fileHandle.readSint16BE();
sizeHEntry = fileHandle.readSint16BE(); // size of one header entry - 20 bytes
for (i = 0; i < numOfDisks; i++) {
// fread(&volumeData[i],20,1,fileHandle);
fileHandle.read(&volumeData[i].ident, 10);
fileHandle.read(&volumeData[i].ptr, 4);
volumeData[i].diskNumber = fileHandle.readSint16BE();
volumeData[i].size = fileHandle.readSint32BE();
debug(1, "Disk number: %d", volumeData[i].diskNumber);
}
for (i = 0; i < numOfDisks; i++) {
dataFileName *ptr;
volumeData[i].size = fileHandle.readSint32BE();
ptr = (dataFileName *) mallocAndZero(volumeData[i].size);
volumeData[i].ptr = ptr;
if (!ptr) {
fileHandle.close();
return (-2);
}
fileHandle.read(ptr, volumeData[i].size);
}
fileHandle.close();
volumeDataLoaded = 1;
//#define dumpResources
#ifdef dumpResources
for (i = 0; i < numOfDisks; i++) {
int j;
char nameBuffer[256];
fileEntry *buffer;
sprintf(nameBuffer, "D%d.", i + 1);
fileHandle.open(nameBuffer);
short int numEntry;
short int sizeEntry;
numEntry = fileHandle.readSint16BE();
sizeEntry = fileHandle.readSint16BE();
buffer = (fileEntry *) mallocAndZero(numEntry * sizeEntry);
for (j = 0; j < numEntry; j++) {
fileHandle.seek(4 + j*0x1E);
fileHandle.read(buffer[j].name, 14);
buffer[j].offset = fileHandle.readSint32BE();
buffer[j].size = fileHandle.readSint32BE();
buffer[j].extSize = fileHandle.readSint32BE();
buffer[j].unk3 = fileHandle.readSint32BE();
fileHandle.seek(buffer[j].offset);
char *bufferLocal;
bufferLocal = (char *)mallocAndZero(buffer[j].size);
fileHandle.read(bufferLocal, buffer[j].size);
char nameBuffer[256];
sprintf(nameBuffer, "%s", buffer[j].name);
if (buffer[j].size == buffer[j].extSize) {
Common::DumpFile fout;
fout.open(nameBuffer);
if (fout.isOpen())
fout.write(bufferLocal, buffer[j].size);
} else {
char *uncompBuffer = (char *)mallocAndZero(buffer[j].extSize + 500);
//.........这里部分代码省略.........