diff options
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/csvformat.cpp')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/csvformat.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/csvformat.cpp b/SQLiteStudio3/coreSQLiteStudio/csvformat.cpp index f5daa60..151fffd 100644 --- a/SQLiteStudio3/coreSQLiteStudio/csvformat.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/csvformat.cpp @@ -1,7 +1,7 @@ #include "csvformat.h" #include <QtGlobal> -const CsvFormat CsvFormat::DEFAULT = {",", "\n"}; +const CsvFormat CsvFormat::DEFAULT = {{","}, {"\r\n", "\n", "\r"}}; CsvFormat::CsvFormat() { @@ -12,6 +12,27 @@ CsvFormat::CsvFormat(const QString& columnSeparator, const QString& rowSeparator { } +CsvFormat::CsvFormat(const QStringList &columnSeparators, const QStringList &rowSeparators) +{ + if (rowSeparators.size() > 1) + { + this->rowSeparators = rowSeparators; + multipleRowSeparators = true; + strictRowSeparator = true; + } + else if (rowSeparators.size() > 0) + this->rowSeparator = rowSeparators.first(); + + if (columnSeparators.size() > 1) + { + this->columnSeparators = columnSeparators; + multipleColumnSeparators = true; + strictColumnSeparator = true; + } + else if (columnSeparators.size() > 0) + this->columnSeparator = columnSeparators.first(); +} + CsvFormat::CsvFormat(const QString& columnSeparator, const QString& rowSeparator, bool strictRowSeparator, bool strictColumnSeparator) : columnSeparator(columnSeparator), rowSeparator(rowSeparator), strictColumnSeparator(strictColumnSeparator), strictRowSeparator(strictRowSeparator) { |
