DataFileReader Class Referenceabstract

#include <DataFileReader.h>

Inheritance diagram for DataFileReader:
Inheritance graph
Collaboration diagram for DataFileReader:
Collaboration graph

Public Member Functions

virtual bool isOK () const =0
 Return true if the file appears to be of the correct type. More...
 
virtual QString getError () const
 
virtual Modelload () const =0
 Read the file and return the corresponding data model. More...
 

Detailed Description

Definition at line 24 of file DataFileReader.h.

Member Function Documentation

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
inlinevirtual

Reimplemented in MIDIFileReader, and CSVFileReader.

Definition at line 42 of file DataFileReader.h.

References load().

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 getError(), DataFileReaderFactory::load(), DataFileReaderFactory::loadCSV(), and DataFileReaderFactory::loadNonCSV().


The documentation for this class was generated from the following file: