svcore
1.9
|
#include <DataFileReader.h>
Public Member Functions | |
virtual bool | isOK () const =0 |
Return true if the file appears to be of the correct type. | |
virtual QString | getError () const |
virtual Model * | load () const =0 |
Read the file and return the corresponding data model. |
Definition at line 24 of file DataFileReader.h.
virtual bool DataFileReader::isOK | ( | ) | const [pure 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.
Implemented in MIDIFileReader, and CSVFileReader.
Referenced by DataFileReaderFactory::createReader().
virtual QString DataFileReader::getError | ( | ) | const [inline, virtual] |
Reimplemented in MIDIFileReader, and CSVFileReader.
Definition at line 42 of file DataFileReader.h.
Referenced by DataFileReaderFactory::createReader().
virtual Model* DataFileReader::load | ( | ) | const [pure 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.
Implemented in MIDIFileReader, and CSVFileReader.
Referenced by DataFileReaderFactory::load(), DataFileReaderFactory::loadCSV(), and DataFileReaderFactory::loadNonCSV().