adds read() for SectionIndexData
updates unit-tests
This commit is contained in:
@@ -153,6 +153,7 @@ public:
|
||||
InMemoryReader(const QByteArray& data);
|
||||
bool initReadHeader();
|
||||
bool read(qint32 entryType, QByteArray &data);
|
||||
bool read(SectionIndexData& sid);
|
||||
qint32 offsetsCount() const { return _offsetsHeader.entriesCount; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -422,6 +422,19 @@ bool InMemoryReader::read(qint32 entryType, QByteArray& data)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InMemoryReader::read(SectionIndexData& sid)
|
||||
{
|
||||
QByteArray sidData;
|
||||
if (!read(ET_SectionIndex, sidData) || sidData.isEmpty())
|
||||
return false;
|
||||
|
||||
QDataStream in(sidData);
|
||||
in.setVersion(QDataStream::Qt_4_5);
|
||||
in >> sid;
|
||||
|
||||
return in.atEnd();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ADS_NAMESPACE_SER_END
|
||||
|
||||
Reference in New Issue
Block a user