Mercurial > hg > svcore
comparison data/fileio/CSVFileWriter.h @ 1527:710e6250a401 zoom
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 17 Sep 2018 13:51:14 +0100 |
parents | 6e9615bde1f9 |
children |
comparison
equal
deleted
inserted
replaced
1324:d4a28d1479a8 | 1527:710e6250a401 |
---|---|
11 published by the Free Software Foundation; either version 2 of the | 11 published by the Free Software Foundation; either version 2 of the |
12 License, or (at your option) any later version. See the file | 12 License, or (at your option) any later version. See the file |
13 COPYING included with this distribution for more information. | 13 COPYING included with this distribution for more information. |
14 */ | 14 */ |
15 | 15 |
16 #ifndef _CSV_FILE_WRITER_H_ | 16 #ifndef SV_CSV_FILE_WRITER_H |
17 #define _CSV_FILE_WRITER_H_ | 17 #define SV_CSV_FILE_WRITER_H |
18 | 18 |
19 #include <QObject> | 19 #include <QObject> |
20 #include <QString> | 20 #include <QString> |
21 | 21 |
22 #include "base/DataExportOptions.h" | 22 #include "base/DataExportOptions.h" |
23 | 23 |
24 class Model; | 24 class Model; |
25 class MultiSelection; | 25 class MultiSelection; |
26 class ProgressReporter; | |
26 | 27 |
27 class CSVFileWriter : public QObject | 28 class CSVFileWriter : public QObject |
28 { | 29 { |
29 Q_OBJECT | 30 Q_OBJECT |
30 | 31 |
31 public: | 32 public: |
32 CSVFileWriter(QString path, | 33 CSVFileWriter(QString path, |
33 Model *model, | 34 Model *model, |
34 QString delimiter = ",", | 35 QString delimiter = ",", |
35 DataExportOptions options = DataExportDefaults); | 36 DataExportOptions options = DataExportDefaults); |
37 | |
38 CSVFileWriter(QString path, | |
39 Model *model, | |
40 ProgressReporter *reporter, | |
41 QString delimiter = ",", | |
42 DataExportOptions options = DataExportDefaults) | |
43 : CSVFileWriter(path, model, delimiter, options) | |
44 { | |
45 m_reporter = reporter; | |
46 } | |
36 virtual ~CSVFileWriter(); | 47 virtual ~CSVFileWriter(); |
37 | 48 |
38 virtual bool isOK() const; | 49 virtual bool isOK() const; |
39 virtual QString getError() const; | 50 virtual QString getError() const; |
40 | 51 |
41 virtual void write(); | 52 virtual void write(); |
42 virtual void writeSelection(MultiSelection *selection); | 53 virtual void writeSelection(MultiSelection selection); |
43 | 54 |
44 protected: | 55 protected: |
45 QString m_path; | 56 QString m_path; |
46 Model *m_model; | 57 Model *m_model; |
47 QString m_error; | 58 QString m_error; |
48 QString m_delimiter; | 59 QString m_delimiter; |
49 DataExportOptions m_options; | 60 DataExportOptions m_options; |
61 ProgressReporter *m_reporter = nullptr; | |
50 }; | 62 }; |
51 | 63 |
52 #endif | 64 #endif |
53 | 65 |
54 | 66 |