hi,
Is there a class that handles file paths in Qt? Particularly I'm looking for something like .NET's Path.Combine.
I know there's one in boost::filesystem but I was wondering if there's one in Qt.
hi,
Is there a class that handles file paths in Qt? Particularly I'm looking for something like .NET's Path.Combine.
I know there's one in boost::filesystem but I was wondering if there's one in Qt.
There is QDir which might be of help (see QDir::relativeFilePath
and QDir::canonicalPath
and others).
Quoting from QDir doc:
A QDir is used to manipulate path names, access information regarding paths and files, and manipulate the underlying file system.
QDir provides access to directory contents and allows various manipulation (mkdir for example). But there are no classes for path components manipulation unfortunately.
Another class that might be useful is QFileInfo
.
From Qt documentation:
The QFileInfo class provides system-independent file information.
QFileInfo provides information about a file's name and position (path) in the file system, its access rights and whether it is a directory or symbolic link, etc. The file's size and last modified/read times are also available. QFileInfo can also be used to obtain information about a Qt resource.