Utils: Allow an offset in FilePath::readContents()

Also, change the size limit to take a qint64. Contrary to e.g.
Q(6)Hash::size() there is a realistic chance that 31 bits are not
enough.

Change-Id: Idbe6e765a5cac4336b3d64a8e0adb14966fd18a3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-07-09 08:30:11 +02:00
parent dba0294b33
commit 97578a4fee
9 changed files with 19 additions and 14 deletions

View File

@@ -1064,12 +1064,12 @@ FilePaths DockerDevice::directoryEntries(const FilePath &filePath,
return {};
}
QByteArray DockerDevice::fileContents(const FilePath &filePath, int limit) const
QByteArray DockerDevice::fileContents(const FilePath &filePath, qint64 limit, qint64 offset) const
{
QTC_ASSERT(handlesFile(filePath), return {});
tryCreateLocalFileAccess();
if (hasLocalFileAccess())
return mapToLocalAccess(filePath).fileContents(limit);
return mapToLocalAccess(filePath).fileContents(limit, offset);
QTC_CHECK(false); // FIXME: Implement
return {};