CSVFileReader Class Reference

#include <CSVFileReader.h>

Inherits DataFileReader.

Inheritance diagram for CSVFileReader:

Inheritance graph
[legend]
Collaboration diagram for CSVFileReader:

Collaboration graph
[legend]
List of all members.

Detailed Description

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 Modelload () const
 Read the file and return the corresponding data model.

Protected Attributes

QFile * m_file
QString m_error
size_t m_mainModelSampleRate


Constructor & Destructor Documentation

CSVFileReader::CSVFileReader ( QString  path,
size_t  mainModelSampleRate 
)

Definition at line 41 of file CSVFileReader.cpp.

References m_error, and m_file.

CSVFileReader::~CSVFileReader (  )  [virtual]

Definition at line 62 of file CSVFileReader.cpp.

References m_file.


Member Function Documentation

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.


Member Data Documentation

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]

Definition at line 43 of file CSVFileReader.h.

Referenced by CSVFileReader(), and getError().

size_t CSVFileReader::m_mainModelSampleRate [protected]

Definition at line 44 of file CSVFileReader.h.

Referenced by load().


The documentation for this class was generated from the following files:
Generated on Wed Feb 20 15:45:32 2008 for SonicVisualiser by  doxygen 1.5.1