#include <CSVFileReader.h>
Inherits DataFileReader.
Inheritance diagram for CSVFileReader:


Definition at line 31 of file CSVFileReader.h.
Public Member Functions | |
| CSVFileReader (QString path, size_t mainModelSampleRate) | |
| virtual | ~CSVFileReader () |
| virtual bool | isOK () const |
| Return true if the file appears to be of the correct type. | |
| virtual QString | getError () const |
| virtual Model * | load () const |
| Read the file and return the corresponding data model. | |
Protected Attributes | |
| QFile * | m_file |
| QString | m_error |
| size_t | m_mainModelSampleRate |
| CSVFileReader::CSVFileReader | ( | QString | path, | |
| size_t | mainModelSampleRate | |||
| ) |
| CSVFileReader::~CSVFileReader | ( | ) | [virtual] |
| bool CSVFileReader::isOK | ( | ) | const [virtual] |
Return true if the file appears to be of the correct type.
The DataFileReader will be constructed by passing a file path to its constructor. If the file can at that time be determined to be not of a type that this reader can read, it should return false in response to any subsequent call to isOK().
If the file is apparently of the correct type, isOK() should return true; if it turns out that the file cannot after all be read (because it's corrupted or the detection misfired), then the read() function may return NULL.
Implements DataFileReader.
Definition at line 74 of file CSVFileReader.cpp.
References m_file.
| QString CSVFileReader::getError | ( | ) | const [virtual] |
Reimplemented from DataFileReader.
Definition at line 80 of file CSVFileReader.cpp.
References m_error.
| Model * CSVFileReader::load | ( | ) | const [virtual] |
Read the file and return the corresponding data model.
This function is not expected to be thread-safe or reentrant. This function may be interactive (i.e. it's permitted to pop up dialogs and windows and ask the user to specify any details that can't be automatically extracted from the file).
Return NULL if the file cannot be parsed at all (although it's preferable to return a partial model and warn the user).
Caller owns the returned model and must delete it after use.
Implements DataFileReader.
Definition at line 86 of file CSVFileReader.cpp.
References SparseValueModel< PointType >::addPoint(), SparseModel< PointType >::addPoint(), CSVFormatDialog::ExplicitTiming, RealTime::frame2RealTime(), CSVFormatDialog::getModelType(), EditableDenseThreeDimensionalModel::getResolution(), CSVFormatDialog::getSampleRate(), CSVFormatDialog::getSeparator(), CSVFormatDialog::getTimeUnits(), CSVFormatDialog::getTimingType(), CSVFormatDialog::getWindowSize(), CSVFormatDialog::ImplicitTiming, DataFileReaderFactory::ImportCancelled, m_file, m_mainModelSampleRate, CSVFormatDialog::OneDimensionalModel, EditableDenseThreeDimensionalModel::setColumn(), EditableDenseThreeDimensionalModel::setMaximumLevel(), EditableDenseThreeDimensionalModel::setMinimumLevel(), CSVFormatDialog::ThreeDimensionalModel, CSVFormatDialog::TimeSeconds, CSVFormatDialog::TimeWindows, and CSVFormatDialog::TwoDimensionalModel.
QFile* CSVFileReader::m_file [protected] |
Definition at line 42 of file CSVFileReader.h.
Referenced by CSVFileReader(), isOK(), load(), and ~CSVFileReader().
QString CSVFileReader::m_error [protected] |
size_t CSVFileReader::m_mainModelSampleRate [protected] |
1.5.1