本文整理汇总了C++中IOBuffer::read方法的典型用法代码示例。如果您正苦于以下问题:C++ IOBuffer::read方法的具体用法?C++ IOBuffer::read怎么用?C++ IOBuffer::read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOBuffer
的用法示例。
在下文中一共展示了IOBuffer::read方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read
// we must be at the right position in the file!
bool CentralDirFileHeader::read(QIODevice* ioDevice)
{
Q_ASSERT(ioDevice);
IOBuffer buffer;
buffer.read( ioDevice, CD_FILE_HEADER_SIZE );
signature = buffer.readUInt32( ); // 0x02014b50
if ( signature != CD_FILE_HEADER_SIGNATURE )
return false;
versionMadeBy = buffer.readUInt16( );
versionNeeded = buffer.readUInt16( );
generalFlag = buffer.readUInt16( );
compressionMethod = buffer.readUInt16( );
lastModFileTime = buffer.readUInt16( );
lastModFileDate = buffer.readUInt16( );
crc_32 = buffer.readUInt32( );
compressedSize = buffer.readUInt32( );
uncompressedSize = buffer.readUInt32( );
filenameLength = buffer.readUInt16( );
extraFieldLength = buffer.readUInt16( );
fileCommentLength = buffer.readUInt16( );
diskNumberStart = buffer.readUInt16( );
internalFileAttr = buffer.readUInt16( );
externalFileAttr = buffer.readUInt32( );
relativeOffset = buffer.readUInt32( );
if (filenameLength)
{
fileName = ioDevice->read( filenameLength );
if ( isUTF8() )
sFileName = QTextCodec::codecForUtfText(fileName)->toUnicode( fileName ); // Save in a QString for convienience (searching etc)
else
sFileName = QTextCodec::codecForLocale()->toUnicode( fileName ); // Save in a QString for convienience (searching etc)
}
readExtraData( ioDevice );
if (fileCommentLength)
comment = ioDevice->read( fileCommentLength );
return isValid();
}