comparison data/fileio/CSVFormat.h @ 1047:26cf6d5251ec cxx11

Further dedicated-types fixes
author Chris Cannam
date Tue, 10 Mar 2015 17:02:52 +0000
parents 1888ca033a84
children 1bf38a4b91c4
comparison
equal deleted inserted replaced
1046:2f49be7d4264 1047:26cf6d5251ec
16 #ifndef _CSV_FORMAT_H_ 16 #ifndef _CSV_FORMAT_H_
17 #define _CSV_FORMAT_H_ 17 #define _CSV_FORMAT_H_
18 18
19 #include <QString> 19 #include <QString>
20 #include <QStringList> 20 #include <QStringList>
21
22 #include "base/BaseTypes.h"
21 23
22 class CSVFormat 24 class CSVFormat
23 { 25 {
24 public: 26 public:
25 enum ModelType { 27 enum ModelType {
86 void guessFormatFor(QString path); 88 void guessFormatFor(QString path);
87 89
88 ModelType getModelType() const { return m_modelType; } 90 ModelType getModelType() const { return m_modelType; }
89 TimingType getTimingType() const { return m_timingType; } 91 TimingType getTimingType() const { return m_timingType; }
90 TimeUnits getTimeUnits() const { return m_timeUnits; } 92 TimeUnits getTimeUnits() const { return m_timeUnits; }
91 int getSampleRate() const { return m_sampleRate; } 93 sv_samplerate_t getSampleRate() const { return m_sampleRate; }
92 int getWindowSize() const { return m_windowSize; } 94 int getWindowSize() const { return m_windowSize; }
93 int getColumnCount() const { return m_columnCount; } 95 int getColumnCount() const { return m_columnCount; }
94 bool getAllowQuoting() const { return m_allowQuoting; } 96 bool getAllowQuoting() const { return m_allowQuoting; }
95 QChar getSeparator() const { 97 QChar getSeparator() const {
96 if (m_separator == "") return ' '; 98 if (m_separator == "") return ' ';
99 101
100 void setModelType(ModelType t) { m_modelType = t; } 102 void setModelType(ModelType t) { m_modelType = t; }
101 void setTimingType(TimingType t) { m_timingType = t; } 103 void setTimingType(TimingType t) { m_timingType = t; }
102 void setTimeUnits(TimeUnits t) { m_timeUnits = t; } 104 void setTimeUnits(TimeUnits t) { m_timeUnits = t; }
103 void setSeparator(QChar s) { m_separator = s; } 105 void setSeparator(QChar s) { m_separator = s; }
104 void setSampleRate(int r) { m_sampleRate = r; } 106 void setSampleRate(sv_samplerate_t r) { m_sampleRate = r; }
105 void setWindowSize(int s) { m_windowSize = s; } 107 void setWindowSize(int s) { m_windowSize = s; }
106 void setColumnCount(int c) { m_columnCount = c; } 108 void setColumnCount(int c) { m_columnCount = c; }
107 void setAllowQuoting(bool q) { m_allowQuoting = q; } 109 void setAllowQuoting(bool q) { m_allowQuoting = q; }
108 110
109 QList<ColumnPurpose> getColumnPurposes() const { return m_columnPurposes; } 111 QList<ColumnPurpose> getColumnPurposes() const { return m_columnPurposes; }
123 protected: 125 protected:
124 ModelType m_modelType; 126 ModelType m_modelType;
125 TimingType m_timingType; 127 TimingType m_timingType;
126 TimeUnits m_timeUnits; 128 TimeUnits m_timeUnits;
127 QString m_separator; 129 QString m_separator;
128 int m_sampleRate; 130 sv_samplerate_t m_sampleRate;
129 int m_windowSize; 131 int m_windowSize;
130 132
131 int m_columnCount; 133 int m_columnCount;
132 bool m_variableColumnCount; 134 bool m_variableColumnCount;
133 135