QGIS API Documentation
3.0.2-Girona (307d082)
|
Class for file utilities. More...
#include <qgsfileutils.h>
Static Public Member Functions | |
static QString | addExtensionFromFilter (const QString &fileName, const QString &filter) |
Ensures that a fileName ends with an extension from the specified filter string. More... | |
static QString | ensureFileNameHasExtension (const QString &fileName, const QStringList &extensions) |
Ensures that a fileName ends with an extension from the provided list of extensions. More... | |
static QStringList | extensionsFromFilter (const QString &filter) |
Returns a list of the extensions contained within a file filter string. More... | |
static QString | representFileSize (qint64 bytes) |
Return the human size from bytes. More... | |
static QString | stringToSafeFilename (const QString &string) |
Converts a string to a safe filename, replacing characters which are not safe for filenames with an '_' character. More... | |
|
static |
Ensures that a fileName ends with an extension from the specified filter string.
E.g. a fileName of "d:/my_file" with a filter of "GeoTIFF Files (*.tiff *.tif)" will return "d:/my_file.tif", where as fileName of "d:/my_file.TIFF" or "d:/my_file.TIF" will be returned unchanged.
Definition at line 81 of file qgsfileutils.cpp.
|
static |
Ensures that a fileName ends with an extension from the provided list of extensions.
E.g. if extensions contains "tif" and "tiff", then a fileName of "d:/my_file" will return "d:/my_file.tif". A fileName of "d:/my_file.TIFF" or "d:/my_file.TIF" will be returned unchanged.
Definition at line 54 of file qgsfileutils.cpp.
|
static |
Returns a list of the extensions contained within a file filter string.
E.g. a filter of "GeoTIFF Files (*.tiff *.tif)" would return a list containing "tiff", "tif". The initial '.' is stripped off the extension.
Definition at line 35 of file qgsfileutils.cpp.
|
static |
Return the human size from bytes.
Definition at line 19 of file qgsfileutils.cpp.
|
static |
Converts a string to a safe filename, replacing characters which are not safe for filenames with an '_' character.
Definition at line 87 of file qgsfileutils.cpp.