Completed the implementation of the CsvWriter for use with Copy and Export.
This commit is contained in:
parent
7a22b4cbea
commit
798f8f51b9
2 changed files with 54 additions and 20 deletions
16
csvwriter.h
16
csvwriter.h
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue