aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/csvformat.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2017-02-09 04:36:04 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2017-02-09 04:36:04 -0500
commitd9aa870e5d509cc7309ab82dd102a937ab58613a (patch)
treed92d03d76b5c390b335f1cfd761f1a0b59ec8496 /SQLiteStudio3/coreSQLiteStudio/csvformat.cpp
parent68ee4cbcbe424b95969c70346283a9f217f63825 (diff)
Imported Upstream version 3.1.1+dfsg1upstream/3.1.1+dfsg1
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/csvformat.cpp')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/csvformat.cpp23
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)
{