summaryrefslogtreecommitdiff
path: root/src/dictionary/DicCsvWriter.h
blob: 376430995a048d25817b26c651868cb13df1f661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef DICCSVWRITER_H
#define DICCSVWRITER_H

#include <QRegExp>
#include <QStringList>

#include "../export-import/CsvData.h"

class Dictionary;
class DicRecord;

class DicCsvWriter
{
public:
    DicCsvWriter( const Dictionary* aDict );    // For writing from a dictionary
    DicCsvWriter( const QList<DicRecord*> aEntries );  // For writing from list of entries

    QString toCsvString( const CsvExportData& aExportData );   // Both for writing from a dictionary and list of entries

private:
    QString dicEntryToString( const DicRecord* aEntry ) const;

private:
    const Dictionary* m_dict;
    QList<DicRecord*> m_entries; // Used both for dictionary and entries
    QStringList m_selectedFieldNames;
    CsvExportData m_params;
    QRegExp m_fieldSepRegExp;
};

#endif // DICCSVWRITER_H