CSVFileWriter.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Chris Cannam.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef SV_CSV_FILE_WRITER_H
17 #define SV_CSV_FILE_WRITER_H
18 
19 #include <QObject>
20 #include <QString>
21 
22 #include "base/DataExportOptions.h"
23 
24 class Model;
25 class MultiSelection;
26 class ProgressReporter;
27 
28 class CSVFileWriter : public QObject
29 {
30  Q_OBJECT
31 
32 public:
33  CSVFileWriter(QString path,
34  Model *model,
35  QString delimiter = ",",
37 
38  CSVFileWriter(QString path,
39  Model *model,
40  ProgressReporter *reporter,
41  QString delimiter = ",",
43  : CSVFileWriter(path, model, delimiter, options)
44  {
45  m_reporter = reporter;
46  }
47  virtual ~CSVFileWriter();
48 
49  virtual bool isOK() const;
50  virtual QString getError() const;
51 
52  virtual void write();
53  virtual void writeSelection(MultiSelection selection);
54 
55 protected:
56  QString m_path;
58  QString m_error;
59  QString m_delimiter;
62 };
63 
64 #endif
65 
66 
virtual QString getError() const
Model * m_model
Definition: CSVFileWriter.h:57
QString m_path
Definition: CSVFileWriter.h:56
CSVFileWriter(QString path, Model *model, ProgressReporter *reporter, QString delimiter=",", DataExportOptions options=DataExportDefaults)
Definition: CSVFileWriter.h:38
QString m_delimiter
Definition: CSVFileWriter.h:59
DataExportOptions m_options
Definition: CSVFileWriter.h:60
CSVFileWriter(QString path, Model *model, QString delimiter=",", DataExportOptions options=DataExportDefaults)
QString m_error
Definition: CSVFileWriter.h:58
virtual void write()
virtual ~CSVFileWriter()
ProgressReporter * m_reporter
Definition: CSVFileWriter.h:61
virtual bool isOK() const
Model is the base class for all data models that represent any sort of data on a time scale based on ...
Definition: Model.h:51
virtual void writeSelection(MultiSelection selection)
int DataExportOptions