svcore  1.9
CSVFileReader.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Chris Cannam.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef _CSV_FILE_READER_H_
17 #define _CSV_FILE_READER_H_
18 
19 #include "DataFileReader.h"
20 
21 #include "CSVFormat.h"
22 
23 #include <QList>
24 #include <QStringList>
25 
26 class QFile;
27 
29 {
30 public:
31  CSVFileReader(QString path, CSVFormat format, int mainModelSampleRate);
32  virtual ~CSVFileReader();
33 
34  virtual bool isOK() const;
35  virtual QString getError() const;
36  virtual Model *load() const;
37 
38 protected:
40  QFile *m_file;
41  QString m_error;
42  mutable int m_warnings;
44 
45  int convertTimeValue(QString, int lineno, int sampleRate,
46  int windowSize) const;
47 };
48 
49 
50 #endif
51 
int m_mainModelSampleRate
Definition: CSVFileReader.h:43
QString m_error
Definition: CSVFileReader.h:41
CSVFormat m_format
Definition: CSVFileReader.h:39
virtual bool isOK() const
Return true if the file appears to be of the correct type.
int convertTimeValue(QString, int lineno, int sampleRate, int windowSize) const
CSVFileReader(QString path, CSVFormat format, int mainModelSampleRate)
QFile * m_file
Definition: CSVFileReader.h:40
virtual QString getError() const
Model is the base class for all data models that represent any sort of data on a time scale based on ...
Definition: Model.h:35
virtual Model * load() const
Read the file and return the corresponding data model.
virtual ~CSVFileReader()