回复: 求助:不用递归统计所有的文件大小
#6 [tomsky 04-17 11:22]
我刚刚写的算法,供参考:
//******************************************************************************
// Function: vStatDirSizeEx
// Description : 统计目录的大小,非递归算法
// Input : const QString & sDirPath
// Input : qint64 & iSize
// Output:
// Return: void
// Access: public
//
// History :
// 1 Date: 2011-04-16
// Author: tomsky
// Modification: Created file
//******************************************************************************
void vStatDirSizeEx(const QString &sDirPath, qint64 &iSize)
{
iSize = 0;
QDir o_dir(sDirPath);
if (!o_dir.exists())
{
return;
}
QStringList slst_dir_path;
slst_dir_path