DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
csvimporter.h
Go to the documentation of this file.
1 #ifndef CSVIMPORTER_H
2 #define CSVIMPORTER_H
3 
4 #include <qtcommons_global.h>
5 #include <QList>
6 #include <QStringList>
7 #include <QException>
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 override { throw *this; }
20  Exception *clone() const override { return new Exception(*this); }
21 
22  const char *what() const noexcept override {
23  return mWhat.toStdString().c_str();
24  }
25 
26  protected:
27  QString mWhat;
28  };
29 
30  CsvImporter();
31 
32  QList<QStringList> import (QString filename);
33 
34  void setSeparator (QChar sep) { mSeparator = sep; }
35 protected:
36  QChar mSeparator;
37  QString::SplitBehavior mSplitBehaviour;
38 };
39 
40 #endif // CSVIMPORTER_H
const char * what() const noexcept override
Definition: csvimporter.h:22
#define QTCOMMONSSHARED_EXPORT
Definition: qtcommons_global.h:16
QChar mSeparator
Definition: csvimporter.h:36
Exception * clone() const override
Definition: csvimporter.h:20
~Exception() noexcept
Definition: csvimporter.h:17
Definition: csvimporter.h:9
Exception(QString what)
Definition: csvimporter.h:14
QString::SplitBehavior mSplitBehaviour
Definition: csvimporter.h:37
void setSeparator(QChar sep)
Definition: csvimporter.h:34
Definition: csvimporter.h:12
QString mWhat
Definition: csvimporter.h:27