Mercurial > hg > svcore
diff data/fileio/CSVFileReader.h @ 1056:c4898e57eea5 tonioni
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 23 Mar 2015 10:04:48 +0000 |
parents | 920699b6989d |
children | cc27f35aa75c |
line wrap: on
line diff
--- a/data/fileio/CSVFileReader.h Mon Nov 10 09:19:49 2014 +0000 +++ b/data/fileio/CSVFileReader.h Mon Mar 23 10:04:48 2015 +0000 @@ -28,16 +28,32 @@ class CSVFileReader : public DataFileReader { public: + /** + * Construct a CSVFileReader to read the CSV file at the given + * path, with the given format. + */ CSVFileReader(QString path, CSVFormat format, int mainModelSampleRate); + + /** + * Construct a CSVFileReader to read from the given + * QIODevice. Caller retains ownership of the QIODevice: the + * CSVFileReader will not close or delete it and it must outlive + * the CSVFileReader. + */ + CSVFileReader(QIODevice *device, CSVFormat format, int mainModelSampleRate); + virtual ~CSVFileReader(); virtual bool isOK() const; virtual QString getError() const; + virtual Model *load() const; protected: CSVFormat m_format; - QFile *m_file; + QIODevice *m_device; + bool m_ownDevice; + QString m_filename; QString m_error; mutable int m_warnings; int m_mainModelSampleRate;