svcore
1.9
|
#include <DataFileReaderFactory.h>
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 DataFileReader * | createReader (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 Model * | load (QString path, MIDIFileImportPreferenceAcquirer *acquirer, int mainModelSampleRate) |
Read the given path, if a suitable reader is available. | |
static Model * | loadNonCSV (QString path, MIDIFileImportPreferenceAcquirer *acquirer, int mainModelSampleRate) |
Read the given path, if a suitable reader is available. | |
static Model * | loadCSV (QString path, CSVFormat format, int mainModelSampleRate) |
Read the given path using the CSV reader with the given format. | |
Static Protected Member Functions | |
static DataFileReader * | createReader (QString path, bool csv, MIDIFileImportPreferenceAcquirer *, CSVFormat format, int mainModelSampleRate) |
Definition at line 27 of file DataFileReaderFactory.h.
Definition at line 30 of file DataFileReaderFactory.h.
QString DataFileReaderFactory::getKnownExtensions | ( | ) | [static] |
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().