Completed the implementation of the CsvWriter for use with Copy and Export.

This commit is contained in:
Eelke Klein 2017-02-04 11:53:20 +01:00
parent 7a22b4cbea
commit 798f8f51b9
2 changed files with 54 additions and 20 deletions

View file

@ -2,22 +2,22 @@
#define CSVWRITER_H
#include <ostream>
#include <QFileDevice>
#include <QTextStream>
class CsvWriter {
public:
CsvWriter();
void setDestination(QFileDevice *output);
void setDestination(QString filename);
explicit CsvWriter(QTextStream *output);
void setDestination(QTextStream *output);
void setSeperator(QChar ch);
void setQuote(QChar ch);
void writeField(QString field);
void nextLine();
void nextRow();
private:
QChar m_seperator = ',';
QChar m_quote = '\'';
QFileDevice *m_output = nullptr;
QChar m_quote = '"';
QTextStream *m_output = nullptr;
int m_column = 0;
};
#endif // CSVWRITER_H