comparison data/fileio/CSVFileReader.h @ 1069:32ab6c48efaa

Merge from branch tonioni
author Chris Cannam
date Mon, 20 Apr 2015 09:11:34 +0100
parents 26cf6d5251ec
children 7f8eb7379280 e22bfe8ca248
comparison
equal deleted inserted replaced
1036:682d64f05e72 1069:32ab6c48efaa
18 18
19 #include "DataFileReader.h" 19 #include "DataFileReader.h"
20 20
21 #include "CSVFormat.h" 21 #include "CSVFormat.h"
22 22
23 #include "base/BaseTypes.h"
24
23 #include <QList> 25 #include <QList>
24 #include <QStringList> 26 #include <QStringList>
25 27
26 class QFile; 28 class QFile;
27 29
30 public: 32 public:
31 /** 33 /**
32 * Construct a CSVFileReader to read the CSV file at the given 34 * Construct a CSVFileReader to read the CSV file at the given
33 * path, with the given format. 35 * path, with the given format.
34 */ 36 */
35 CSVFileReader(QString path, CSVFormat format, int mainModelSampleRate); 37 CSVFileReader(QString path, CSVFormat format, sv_samplerate_t mainModelSampleRate);
36 38
37 /** 39 /**
38 * Construct a CSVFileReader to read from the given 40 * Construct a CSVFileReader to read from the given
39 * QIODevice. Caller retains ownership of the QIODevice: the 41 * QIODevice. Caller retains ownership of the QIODevice: the
40 * CSVFileReader will not close or delete it and it must outlive 42 * CSVFileReader will not close or delete it and it must outlive
41 * the CSVFileReader. 43 * the CSVFileReader.
42 */ 44 */
43 CSVFileReader(QIODevice *device, CSVFormat format, int mainModelSampleRate); 45 CSVFileReader(QIODevice *device, CSVFormat format, sv_samplerate_t mainModelSampleRate);
44 46
45 virtual ~CSVFileReader(); 47 virtual ~CSVFileReader();
46 48
47 virtual bool isOK() const; 49 virtual bool isOK() const;
48 virtual QString getError() const; 50 virtual QString getError() const;
54 QIODevice *m_device; 56 QIODevice *m_device;
55 bool m_ownDevice; 57 bool m_ownDevice;
56 QString m_filename; 58 QString m_filename;
57 QString m_error; 59 QString m_error;
58 mutable int m_warnings; 60 mutable int m_warnings;
59 int m_mainModelSampleRate; 61 sv_samplerate_t m_mainModelSampleRate;
60 62
61 int convertTimeValue(QString, int lineno, int sampleRate, 63 sv_frame_t convertTimeValue(QString, int lineno, sv_samplerate_t sampleRate,
62 int windowSize) const; 64 int windowSize) const;
63 }; 65 };
64 66
65 67
66 #endif 68 #endif
67 69