aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/csvformat.h
blob: 79807cba44cf722b386e7f7ce8969246d4159077 (plain) (blame)
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
32
#ifndef CSVFORMAT_H
#define CSVFORMAT_H

#include "coreSQLiteStudio_global.h"
#include <QString>
#include <QStringList>

struct API_EXPORT CsvFormat
{
    CsvFormat();
    CsvFormat(const QString& columnSeparator, const QString& rowSeparator);
    CsvFormat(const QStringList& columnSeparators, const QStringList& rowSeparators);
    CsvFormat(const QString& columnSeparator, const QString& rowSeparator, bool strictRowSeparator, bool strictColumnSeparator);

    void calculateSeparatorMaxLengths();

    QString columnSeparator;
    QString rowSeparator;
    QStringList columnSeparators;
    QStringList rowSeparators;
    bool strictColumnSeparator = false;
    bool strictRowSeparator = false;
    bool multipleRowSeparators = false;
    bool multipleColumnSeparators = false;
    int maxColumnSeparatorLength = 0;
    int maxRowSeparatorLength = 0;
    bool quotationMark = true;

    static const CsvFormat DEFAULT;
};

#endif // CSVFORMAT_H