svcore  1.9
DataFileReaderFactory Class Reference

#include <DataFileReaderFactory.h>

List of all members.

Public Types

enum  Exception { ImportCancelled }

Static Public Member Functions

static QString getKnownExtensions ()
 Return the file extensions that we have data file readers for, in a format suitable for use with QFileDialog.
static DataFileReadercreateReader (QString path, MIDIFileImportPreferenceAcquirer *, int mainModelSampleRate)
 Return a data file reader initialised to the file at the given path, or NULL if no suitable reader for this path is available or the file cannot be opened.
static Modelload (QString path, MIDIFileImportPreferenceAcquirer *acquirer, int mainModelSampleRate)
 Read the given path, if a suitable reader is available.
static ModelloadNonCSV (QString path, MIDIFileImportPreferenceAcquirer *acquirer, int mainModelSampleRate)
 Read the given path, if a suitable reader is available.
static ModelloadCSV (QString path, CSVFormat format, int mainModelSampleRate)
 Read the given path using the CSV reader with the given format.

Static Protected Member Functions

static DataFileReadercreateReader (QString path, bool csv, MIDIFileImportPreferenceAcquirer *, CSVFormat format, int mainModelSampleRate)

Detailed Description

Definition at line 27 of file DataFileReaderFactory.h.


Member Enumeration Documentation

Enumerator:
ImportCancelled 

Definition at line 30 of file DataFileReaderFactory.h.


Member Function Documentation

Return the file extensions that we have data file readers for, in a format suitable for use with QFileDialog.

For example, "*.csv *.xml".

Definition at line 25 of file DataFileReaderFactory.cpp.

DataFileReader * DataFileReaderFactory::createReader ( QString  path,
MIDIFileImportPreferenceAcquirer acquirer,
int  mainModelSampleRate 
) [static]

Return a data file reader initialised to the file at the given path, or NULL if no suitable reader for this path is available or the file cannot be opened.

Caller owns the returned object and must delete it after use.

Note that this function is non-interactive -- the user is not asked for file format preferences.

Definition at line 59 of file DataFileReaderFactory.cpp.

Referenced by load(), loadCSV(), and loadNonCSV().

Model * DataFileReaderFactory::load ( QString  path,
MIDIFileImportPreferenceAcquirer acquirer,
int  mainModelSampleRate 
) [static]

Read the given path, if a suitable reader is available.

Return NULL if no reader succeeded in reading this file.

Note that this function is non-interactive -- the user is not asked for file format preferences. If the CSV file reader is used, it is with default format.

Definition at line 75 of file DataFileReaderFactory.cpp.

References createReader(), and DataFileReader::load().

Model * DataFileReaderFactory::loadNonCSV ( QString  path,
MIDIFileImportPreferenceAcquirer acquirer,
int  mainModelSampleRate 
) [static]

Read the given path, if a suitable reader is available.

Return NULL if no reader succeeded in reading this file. Do not attempt the general CSV reader.

Definition at line 95 of file DataFileReaderFactory.cpp.

References createReader(), and DataFileReader::load().

Model * DataFileReaderFactory::loadCSV ( QString  path,
CSVFormat  format,
int  mainModelSampleRate 
) [static]

Read the given path using the CSV reader with the given format.

Return NULL if it failed in reading this file.

Definition at line 116 of file DataFileReaderFactory.cpp.

References createReader(), and DataFileReader::load().

DataFileReader * DataFileReaderFactory::createReader ( QString  path,
bool  csv,
MIDIFileImportPreferenceAcquirer acquirer,
CSVFormat  format,
int  mainModelSampleRate 
) [static, protected]

Definition at line 31 of file DataFileReaderFactory.cpp.

References DataFileReader::getError(), and DataFileReader::isOK().


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