QGIS API Documentation  3.2.0-Bonn (bc43194)
qgsfileutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsfileutils.h
3  ---------------------------
4  begin : November 2017
5  copyright : (C) 2017 by Etienne Trimaille
6  email : etienne dot trimaille at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSFILEUTILS_H
19 #define QGSFILEUTILS_H
20 
21 #include "qgis.h"
22 
29 class CORE_EXPORT QgsFileUtils
30 {
31  public:
32 
36  static QString representFileSize( qint64 bytes );
37 
38 
46  static QStringList extensionsFromFilter( const QString &filter );
47 
59  static QString ensureFileNameHasExtension( const QString &fileName, const QStringList &extensions );
60 
72  static QString addExtensionFromFilter( const QString &fileName, const QString &filter );
73 
80  static QString stringToSafeFilename( const QString &string );
81 };
82 
83 #endif // QGSFILEUTILS_H
Class for file utilities.
Definition: qgsfileutils.h:29