DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
csvexporter.h
Go to the documentation of this file.
1 #ifndef CSVEXPORTER_H
2 #define CSVEXPORTER_H
3 
4 #include <qtcommons_global.h>
5 #include <QException>
6 #include <QString>
7 #include <QStringList>
8 
10 {
11 public:
12  class Exception : public QException {
13  public:
14  explicit Exception (QString what)
15  : mWhat(what) {
16  }
17  ~Exception() noexcept {}
18 
19  void raise() const { throw *this; }
20  Exception *clone() const { return new Exception(*this); }
21 
22  const char *what() const noexcept {
23  return mWhat.toStdString().c_str();
24  }
25 
26  protected:
27  QString mWhat;
28  };
29 
30  CsvExporter();
31 
32  bool exportFile(QString filename, const QList<QStringList> & list);
33  void setSeparator (QChar sep) { mSeparator = sep; }
34 
35 private:
36  QChar mSeparator;
37 };
38 
39 #endif // CSVEXPORTER_H
void setSeparator(QChar sep)
Definition: csvexporter.h:33
Definition: csvexporter.h:9
#define QTCOMMONSSHARED_EXPORT
Definition: qtcommons_global.h:16
Exception * clone() const
Definition: csvexporter.h:20
Exception(QString what)
Definition: csvexporter.h:14
const char * what() const noexcept
Definition: csvexporter.h:22
~Exception() noexcept
Definition: csvexporter.h:17
QString mWhat
Definition: csvexporter.h:27
Definition: csvexporter.h:12