comparison data/fileio/CSVFileReader.cpp @ 1047:26cf6d5251ec cxx11

Further dedicated-types fixes
author Chris Cannam
date Tue, 10 Mar 2015 17:02:52 +0000
parents cc27f35aa75c
children ed207f89aaef e22bfe8ca248
comparison
equal deleted inserted replaced
1046:2f49be7d4264 1047:26cf6d5251ec
34 34
35 #include <iostream> 35 #include <iostream>
36 #include <map> 36 #include <map>
37 37
38 CSVFileReader::CSVFileReader(QString path, CSVFormat format, 38 CSVFileReader::CSVFileReader(QString path, CSVFormat format,
39 int mainModelSampleRate) : 39 sv_samplerate_t mainModelSampleRate) :
40 m_format(format), 40 m_format(format),
41 m_device(0), 41 m_device(0),
42 m_ownDevice(true), 42 m_ownDevice(true),
43 m_warnings(0), 43 m_warnings(0),
44 m_mainModelSampleRate(mainModelSampleRate) 44 m_mainModelSampleRate(mainModelSampleRate)
61 delete file; 61 delete file;
62 } 62 }
63 } 63 }
64 64
65 CSVFileReader::CSVFileReader(QIODevice *device, CSVFormat format, 65 CSVFileReader::CSVFileReader(QIODevice *device, CSVFormat format,
66 int mainModelSampleRate) : 66 sv_samplerate_t mainModelSampleRate) :
67 m_format(format), 67 m_format(format),
68 m_device(device), 68 m_device(device),
69 m_ownDevice(false), 69 m_ownDevice(false),
70 m_warnings(0), 70 m_warnings(0),
71 m_mainModelSampleRate(mainModelSampleRate) 71 m_mainModelSampleRate(mainModelSampleRate)
94 { 94 {
95 return m_error; 95 return m_error;
96 } 96 }
97 97
98 sv_frame_t 98 sv_frame_t
99 CSVFileReader::convertTimeValue(QString s, int lineno, int sampleRate, 99 CSVFileReader::convertTimeValue(QString s, int lineno,
100 sv_samplerate_t sampleRate,
100 int windowSize) const 101 int windowSize) const
101 { 102 {
102 QRegExp nonNumericRx("[^0-9eE.,+-]"); 103 QRegExp nonNumericRx("[^0-9eE.,+-]");
103 int warnLimit = 10; 104 int warnLimit = 10;
104 105
153 if (!m_device) return 0; 154 if (!m_device) return 0;
154 155
155 CSVFormat::ModelType modelType = m_format.getModelType(); 156 CSVFormat::ModelType modelType = m_format.getModelType();
156 CSVFormat::TimingType timingType = m_format.getTimingType(); 157 CSVFormat::TimingType timingType = m_format.getTimingType();
157 CSVFormat::TimeUnits timeUnits = m_format.getTimeUnits(); 158 CSVFormat::TimeUnits timeUnits = m_format.getTimeUnits();
158 int sampleRate = m_format.getSampleRate(); 159 sv_samplerate_t sampleRate = m_format.getSampleRate();
159 int windowSize = m_format.getWindowSize(); 160 int windowSize = m_format.getWindowSize();
160 QChar separator = m_format.getSeparator(); 161 QChar separator = m_format.getSeparator();
161 bool allowQuoting = m_format.getAllowQuoting(); 162 bool allowQuoting = m_format.getAllowQuoting();
162 163
163 if (timingType == CSVFormat::ExplicitTiming) { 164 if (timingType == CSVFormat::ExplicitTiming) {