-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfileformat.h
33 lines (28 loc) · 875 Bytes
/
fileformat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef FILEFORMAT_H
#define FILEFORMAT_H
#include <QtCore>
// File formats as
typedef enum { PXV_XY_FILE,
PXV_ARL_FILE,
PXV_TSV_FILE,
PXV_CSV_FILE } FileFormatIDX;
class FileFormat : private QObject
{
Q_OBJECT // we use QObject only to inherit tr()
public:
FileFormat();
// Guess format from name
FileFormatIDX guessFromName(const QString & fn);
// Create filter stting for QFileDialog
const QString & filterString();
// format from selected filter
FileFormatIDX guessFromFilter(const QString & s);
// Guess from filter if available, from filename if not
FileFormatIDX guess(const QString & name, const QString & filter);
private:
int index(FileFormatIDX j); // index of file type
QStringList descr;
QList<FileFormatIDX> ids;
QString filter;
};
#endif // FILEFORMAT_H