Utils: Introduce FilePath::fileSize()

And implement it locally and for docker.

Change-Id: I362f4cae95560836d9300473a286429eb4569329
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2021-07-23 12:06:38 +02:00
parent dbc708fe61
commit 764bf7396c
10 changed files with 46 additions and 0 deletions

View File

@@ -1279,6 +1279,15 @@ bool FilePath::renameFile(const FilePath &target) const
return QFile::rename(path(), target.path());
}
qint64 FilePath::fileSize() const
{
if (needsDevice()) {
QTC_ASSERT(s_deviceHooks.fileSize, return false);
return s_deviceHooks.fileSize(*this);
}
return QFileInfo(m_data).size();
}
QTextStream &operator<<(QTextStream &s, const FilePath &fn)
{
return s << fn.toString();