Commit 1b9c9f74 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen Committed by Daniel Molkentin
Browse files

move api docs to ... the api



\fn is a fallback for stuff from headers

Change-Id: I7c5a187bf2cfae2682fd267f30da479488d2592e
Reviewed-by: default avatarDaniel Molkentin <daniel.molkentin@nokia.com>
parent e70e880d
......@@ -53,57 +53,12 @@ namespace Utils {
*/
/*!
\fn Utils::FileUtils::removeRecursively(const QString &filePath, QString *error)
Removes the directory \a filePath and its subdirectories recursively.
\note The \a error parameter is optional.
\return Whether the operation succeeded.
*/
/*!
\fn Utils::FileUtils::copyRecursively(const QString &srcFilePath, const QString &tgtFilePath, QString *error)
Copies the directory specified by \a srcFilePath recursively to \a tgtFilePath. \a tgtFilePath will contain
the target directory, which will be created. Example usage:
\code
QString error;
book ok = Utils::FileUtils::copyRecursively("/foo/bar", "/foo/baz", &error);
if (!ok)
qDebug() << error;
\endcode
This will copy the contents of /foo/bar into to the baz directory under /foo, which will be created in the process.
\note The \a error parameter is optional.
\return Whether the operation succeeded.
*/
/*!
\fn Utils::FileUtils::isFileNewerThan(const QString &filePath, const QDateTime &timeStamp)
If \a filePath is a directory, the function will recursively check all files and return
true if one of them is newer than \a timeStamp. If \a filePath is a single file, true will
be returned if the file is newer than \timeStamp.
\return Whether at least one file in \a filePath has a newer date than \a timeStamp.
*/
/*!
\fn Utils::FileUtils::resolveSymlinks(const QString &filePath)
Recursively resolve possibly present symlinks in \a filePath.
Unlike QFileInfo::canonicalFilePath(), this function will still return the expected target file
even if the symlink is dangling.
\note Maximum recursion depth == 16.
return Symlink target file path.
*/
bool FileUtils::removeRecursively(const QString &filePath, QString *error)
{
QFileInfo fileInfo(filePath);
......@@ -153,6 +108,23 @@ bool FileUtils::removeRecursively(const QString &filePath, QString *error)
return true;
}
/*!
Copies the directory specified by \a srcFilePath recursively to \a tgtFilePath. \a tgtFilePath will contain
the target directory, which will be created. Example usage:
\code
QString error;
book ok = Utils::FileUtils::copyRecursively("/foo/bar", "/foo/baz", &error);
if (!ok)
qDebug() << error;
\endcode
This will copy the contents of /foo/bar into to the baz directory under /foo, which will be created in the process.
\note The \a error parameter is optional.
\return Whether the operation succeeded.
*/
bool FileUtils::copyRecursively(const QString &srcFilePath,
const QString &tgtFilePath, QString *error)
{
......@@ -190,6 +162,13 @@ bool FileUtils::copyRecursively(const QString &srcFilePath,
return true;
}
/*!
If \a filePath is a directory, the function will recursively check all files and return
true if one of them is newer than \a timeStamp. If \a filePath is a single file, true will
be returned if the file is newer than \timeStamp.
\return Whether at least one file in \a filePath has a newer date than \a timeStamp.
*/
bool FileUtils::isFileNewerThan(const QString &filePath,
const QDateTime &timeStamp)
{
......@@ -209,6 +188,15 @@ bool FileUtils::isFileNewerThan(const QString &filePath,
return false;
}
/*!
Recursively resolve possibly present symlinks in \a filePath.
Unlike QFileInfo::canonicalFilePath(), this function will still return the expected target file
even if the symlink is dangling.
\note Maximum recursion depth == 16.
return Symlink target file path.
*/
QString FileUtils::resolveSymlinks(const QString &path)
{
QFileInfo f(path);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment