COMMON: Add possibility to compute md5 for tail of resfork data
This commit is contained in:
parent
d4443ed494
commit
4eea8524f7
2 changed files with 6 additions and 2 deletions
|
@ -102,7 +102,7 @@ uint32 MacResManager::getResForkDataSize() const {
|
||||||
return _stream->readUint32BE();
|
return _stream->readUint32BE();
|
||||||
}
|
}
|
||||||
|
|
||||||
String MacResManager::computeResForkMD5AsString(uint32 length) const {
|
String MacResManager::computeResForkMD5AsString(uint32 length, bool tail) const {
|
||||||
if (!hasResFork())
|
if (!hasResFork())
|
||||||
return String();
|
return String();
|
||||||
|
|
||||||
|
@ -113,6 +113,9 @@ String MacResManager::computeResForkMD5AsString(uint32 length) const {
|
||||||
|
|
||||||
|
|
||||||
SeekableSubReadStream resForkStream(_stream, dataOffset, dataOffset + dataLength);
|
SeekableSubReadStream resForkStream(_stream, dataOffset, dataOffset + dataLength);
|
||||||
|
if (tail && dataLength > length)
|
||||||
|
resForkStream.seek(length, SEEK_END);
|
||||||
|
|
||||||
return computeStreamMD5AsString(resForkStream, MIN<uint32>(length, _resForkSize));
|
return computeStreamMD5AsString(resForkStream, MIN<uint32>(length, _resForkSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -170,9 +170,10 @@ public:
|
||||||
/**
|
/**
|
||||||
* Calculate the MD5 checksum of the resource fork
|
* Calculate the MD5 checksum of the resource fork
|
||||||
* @param length The maximum length to compute for
|
* @param length The maximum length to compute for
|
||||||
|
* @param tail Caluclate length from the tail
|
||||||
* @return The MD5 checksum of the resource fork
|
* @return The MD5 checksum of the resource fork
|
||||||
*/
|
*/
|
||||||
String computeResForkMD5AsString(uint32 length = 0) const;
|
String computeResForkMD5AsString(uint32 length = 0, bool tail = false) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the base file name of the data/resource fork pair
|
* Get the base file name of the data/resource fork pair
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue