comparison data/fileio/CSVFileWriter.h @ 1435:365876627fb0 streaming-csv-writer

Add constructor overload for using an optional ProgressReporter
author Lucas Thompson <dev@lucas.im>
date Tue, 17 Apr 2018 10:03:49 +0100
parents 074d7c51e973
children 09c2ba31a711
comparison
equal deleted inserted replaced
1434:0684c6698e3f 1435:365876627fb0
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(
39 QString path,
40 Model *model,
41 ProgressReporter *reporter,
42 QString delimiter = ",",
43 DataExportOptions options = DataExportDefaults
44 ) : CSVFileWriter(path, model, delimiter, options)
45 {
46 m_reporter = reporter;
47 }
36 virtual ~CSVFileWriter(); 48 virtual ~CSVFileWriter();
37 49
38 virtual bool isOK() const; 50 virtual bool isOK() const;
39 virtual QString getError() const; 51 virtual QString getError() const;
40 52
45 QString m_path; 57 QString m_path;
46 Model *m_model; 58 Model *m_model;
47 QString m_error; 59 QString m_error;
48 QString m_delimiter; 60 QString m_delimiter;
49 DataExportOptions m_options; 61 DataExportOptions m_options;
62 ProgressReporter *m_reporter;
50 }; 63 };
51 64
52 #endif 65 #endif
53 66
54 67