FileUtils Class Reference

Static Public Member Functions

static QString cdUpUntilExists (QString path)
 Moves upwards the path until it finds the path that exists. More...
 
static Qt::CaseSensitivity comparisonSensitivity ()
 
static bool containsPath (const QStringList &candidates, const QString &path)
 Uses QFileInfo::operator== to see if 'path' is on 'candidates' list. More...
 
static QByteArray md5 (const QString &path)
 
static bool rmAllFiles (const QString &dirPath, const QStringList &nameFilters=QStringList())
 Deletes all files in specified directory. More...
 

Detailed Description

Definition at line 31 of file fileutils.h.

Member Function Documentation

QString FileUtils::cdUpUntilExists ( QString  path)
static

Moves upwards the path until it finds the path that exists.

Returns
A path to the first file system node that exists or an empty string if none of the nodes exist on the path.

Definition at line 45 of file fileutils.cpp.

bool FileUtils::containsPath ( const QStringList &  candidates,
const QString &  path 
)
static

Uses QFileInfo::operator== to see if 'path' is on 'candidates' list.

Definition at line 69 of file fileutils.cpp.

bool FileUtils::rmAllFiles ( const QString &  dirPath,
const QStringList &  nameFilters = QStringList() 
)
static

Deletes all files in specified directory.

Attempts to delete all files it can. If one file cannot be deleted then this method will proceed to the next one until all files are iterated over. Failure to delete even one file will result in 'false' being returned.

Parameters
dirPathPath to the directory.
nameFiltersFilters as in QDir::setNameFilters().
filtersQDir::Filter
Returns
true if all files were successfully deleted.

Definition at line 79 of file fileutils.cpp.


The documentation for this class was generated from the following files: