aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/csvserializer.h
blob: 0b7e0953d2b38243d2a9dd2bb46027a0cee82b4d (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
#ifndef CSVSERIALIZER_H
#define CSVSERIALIZER_H

#include "coreSQLiteStudio_global.h"
#include "csvformat.h"

#include <QTextStream>

class API_EXPORT CsvSerializer
{
    public:
        static QString serialize(const QList<QStringList>& data, const CsvFormat& format);
        static QString serialize(const QStringList& data, const CsvFormat& format);
        static QList<QStringList> deserialize(const QString& data, const CsvFormat& format);
        static QList<QList<QByteArray>> deserialize(const QByteArray& data, const CsvFormat& format);
        static QList<QStringList> deserialize(QTextStream& data, const CsvFormat& format);
        static QStringList deserializeOneEntry(QTextStream& data, const CsvFormat& format);

    private:
        static QList<QStringList> deserialize(QTextStream& data, const CsvFormat& format, bool oneEntry);
};

#endif // CSVSERIALIZER_H