svcore  1.9
CSVFormat Class Reference

#include <CSVFormat.h>

List of all members.

Public Types

enum  ModelType {
  OneDimensionalModel, TwoDimensionalModel, TwoDimensionalModelWithDuration, TwoDimensionalModelWithDurationAndPitch,
  ThreeDimensionalModel
}
enum  TimingType { ExplicitTiming, ImplicitTiming }
enum  TimeUnits { TimeSeconds, TimeAudioFrames, TimeWindows }
enum  ColumnPurpose {
  ColumnUnknown, ColumnStartTime, ColumnEndTime, ColumnDuration,
  ColumnValue, ColumnPitch, ColumnLabel
}
enum  ColumnQuality { ColumnNumeric = 0x1, ColumnIntegral = 0x2, ColumnIncreasing = 0x4, ColumnLarge = 0x8 }
typedef unsigned int ColumnQualities

Public Member Functions

 CSVFormat ()
 CSVFormat (QString path)
void guessFormatFor (QString path)
 Guess the format of the given CSV file, setting the fields in this object accordingly.
ModelType getModelType () const
TimingType getTimingType () const
TimeUnits getTimeUnits () const
int getSampleRate () const
int getWindowSize () const
int getColumnCount () const
bool getAllowQuoting () const
QChar getSeparator () const
void setModelType (ModelType t)
void setTimingType (TimingType t)
void setTimeUnits (TimeUnits t)
void setSeparator (QChar s)
void setSampleRate (int r)
void setWindowSize (int s)
void setColumnCount (int c)
void setAllowQuoting (bool q)
QList< ColumnPurposegetColumnPurposes () const
void setColumnPurposes (QList< ColumnPurpose > cl)
ColumnPurpose getColumnPurpose (int i)
ColumnPurpose getColumnPurpose (int i) const
void setColumnPurpose (int i, ColumnPurpose p)
QList< ColumnQualitiesgetColumnQualities () const
QList< QStringList > getExample () const
int getMaxExampleCols () const

Protected Member Functions

void guessSeparator (QString line)
void guessQualities (QString line, int lineno)
void guessPurposes ()
void guessFormatFor_Old (QString path)

Protected Attributes

ModelType m_modelType
TimingType m_timingType
TimeUnits m_timeUnits
QString m_separator
int m_sampleRate
int m_windowSize
int m_columnCount
bool m_variableColumnCount
QList< ColumnQualitiesm_columnQualities
QList< ColumnPurposem_columnPurposes
QList< float > m_prevValues
bool m_allowQuoting
QList< QStringList > m_example
int m_maxExampleCols

Detailed Description

Definition at line 22 of file CSVFormat.h.


Member Typedef Documentation

typedef unsigned int CSVFormat::ColumnQualities

Definition at line 60 of file CSVFormat.h.


Member Enumeration Documentation

Enumerator:
OneDimensionalModel 
TwoDimensionalModel 
TwoDimensionalModelWithDuration 
TwoDimensionalModelWithDurationAndPitch 
ThreeDimensionalModel 

Definition at line 25 of file CSVFormat.h.

Enumerator:
ExplicitTiming 
ImplicitTiming 

Definition at line 33 of file CSVFormat.h.

Enumerator:
TimeSeconds 
TimeAudioFrames 
TimeWindows 

Definition at line 38 of file CSVFormat.h.

Enumerator:
ColumnUnknown 
ColumnStartTime 
ColumnEndTime 
ColumnDuration 
ColumnValue 
ColumnPitch 
ColumnLabel 

Definition at line 44 of file CSVFormat.h.

Enumerator:
ColumnNumeric 
ColumnIntegral 
ColumnIncreasing 
ColumnLarge 

Definition at line 54 of file CSVFormat.h.


Constructor & Destructor Documentation

CSVFormat::CSVFormat ( ) [inline]

Definition at line 62 of file CSVFormat.h.

CSVFormat::CSVFormat ( QString  path)

Definition at line 28 of file CSVFormat.cpp.

References guessFormatFor().


Member Function Documentation

void CSVFormat::guessFormatFor ( QString  path)

Guess the format of the given CSV file, setting the fields in this object accordingly.

If the current separator is the empty string, the separator character will also be guessed; otherwise the current separator will be used. The other properties of this object will be set according to guesses from the file.

Definition at line 38 of file CSVFormat.cpp.

References ExplicitTiming, guessPurposes(), guessQualities(), m_columnCount, m_columnPurposes, m_columnQualities, m_example, m_maxExampleCols, m_modelType, m_prevValues, m_timeUnits, m_timingType, m_variableColumnCount, TimeSeconds, and TwoDimensionalModel.

Referenced by CSVFormat().

ModelType CSVFormat::getModelType ( ) const [inline]

Definition at line 86 of file CSVFormat.h.

References m_modelType.

Referenced by CSVFileReader::load().

Definition at line 87 of file CSVFormat.h.

References m_timingType.

Referenced by CSVFileReader::load().

TimeUnits CSVFormat::getTimeUnits ( ) const [inline]

Definition at line 88 of file CSVFormat.h.

References m_timeUnits.

Referenced by CSVFileReader::convertTimeValue(), and CSVFileReader::load().

int CSVFormat::getSampleRate ( ) const [inline]

Definition at line 89 of file CSVFormat.h.

References m_sampleRate.

Referenced by CSVFileReader::load().

int CSVFormat::getWindowSize ( ) const [inline]

Definition at line 90 of file CSVFormat.h.

References m_windowSize.

Referenced by CSVFileReader::load().

int CSVFormat::getColumnCount ( ) const [inline]

Definition at line 91 of file CSVFormat.h.

References m_columnCount.

Referenced by CSVFileReader::load().

bool CSVFormat::getAllowQuoting ( ) const [inline]

Definition at line 92 of file CSVFormat.h.

References m_allowQuoting.

Referenced by CSVFileReader::load().

QChar CSVFormat::getSeparator ( ) const [inline]

Definition at line 93 of file CSVFormat.h.

References m_separator.

Referenced by CSVFileReader::load().

void CSVFormat::setModelType ( ModelType  t) [inline]

Definition at line 98 of file CSVFormat.h.

References m_modelType.

void CSVFormat::setTimingType ( TimingType  t) [inline]

Definition at line 99 of file CSVFormat.h.

References m_timingType.

void CSVFormat::setTimeUnits ( TimeUnits  t) [inline]

Definition at line 100 of file CSVFormat.h.

References m_timeUnits.

void CSVFormat::setSeparator ( QChar  s) [inline]

Definition at line 101 of file CSVFormat.h.

References m_separator.

void CSVFormat::setSampleRate ( int  r) [inline]

Definition at line 102 of file CSVFormat.h.

References m_sampleRate.

void CSVFormat::setWindowSize ( int  s) [inline]

Definition at line 103 of file CSVFormat.h.

References m_windowSize.

void CSVFormat::setColumnCount ( int  c) [inline]

Definition at line 104 of file CSVFormat.h.

References m_columnCount.

void CSVFormat::setAllowQuoting ( bool  q) [inline]

Definition at line 105 of file CSVFormat.h.

References m_allowQuoting.

QList<ColumnPurpose> CSVFormat::getColumnPurposes ( ) const [inline]

Definition at line 107 of file CSVFormat.h.

References m_columnPurposes.

void CSVFormat::setColumnPurposes ( QList< ColumnPurpose cl) [inline]

Definition at line 108 of file CSVFormat.h.

References m_columnPurposes.

Definition at line 303 of file CSVFormat.cpp.

References ColumnUnknown, and m_columnPurposes.

Referenced by CSVFileReader::load().

Definition at line 312 of file CSVFormat.cpp.

References ColumnUnknown, and m_columnPurposes.

void CSVFormat::setColumnPurpose ( int  i,
ColumnPurpose  p 
)

Definition at line 321 of file CSVFormat.cpp.

References ColumnUnknown, and m_columnPurposes.

Referenced by guessPurposes().

Definition at line 115 of file CSVFormat.h.

References m_columnQualities.

QList<QStringList> CSVFormat::getExample ( ) const [inline]

Definition at line 118 of file CSVFormat.h.

References m_example.

int CSVFormat::getMaxExampleCols ( ) const [inline]

Definition at line 119 of file CSVFormat.h.

References m_maxExampleCols.

void CSVFormat::guessSeparator ( QString  line) [protected]

Definition at line 86 of file CSVFormat.cpp.

References m_allowQuoting, m_separator, and StringBits::split().

Referenced by guessQualities().

void CSVFormat::guessFormatFor_Old ( QString  path) [protected]

Member Data Documentation

Definition at line 122 of file CSVFormat.h.

Referenced by getModelType(), guessFormatFor(), guessPurposes(), and setModelType().

Definition at line 124 of file CSVFormat.h.

Referenced by getTimeUnits(), guessFormatFor(), guessPurposes(), and setTimeUnits().

QString CSVFormat::m_separator [protected]

Definition at line 125 of file CSVFormat.h.

Referenced by getSeparator(), guessQualities(), guessSeparator(), and setSeparator().

int CSVFormat::m_sampleRate [protected]

Definition at line 126 of file CSVFormat.h.

Referenced by getSampleRate(), and setSampleRate().

int CSVFormat::m_windowSize [protected]

Definition at line 127 of file CSVFormat.h.

Referenced by getWindowSize(), and setWindowSize().

Definition at line 130 of file CSVFormat.h.

Referenced by guessFormatFor(), and guessQualities().

QList<float> CSVFormat::m_prevValues [protected]

Definition at line 135 of file CSVFormat.h.

Referenced by guessFormatFor(), and guessQualities().

bool CSVFormat::m_allowQuoting [protected]

Definition at line 137 of file CSVFormat.h.

Referenced by getAllowQuoting(), guessQualities(), guessSeparator(), and setAllowQuoting().

QList<QStringList> CSVFormat::m_example [protected]

Definition at line 139 of file CSVFormat.h.

Referenced by getExample(), guessFormatFor(), and guessQualities().

int CSVFormat::m_maxExampleCols [protected]

Definition at line 140 of file CSVFormat.h.

Referenced by getMaxExampleCols(), guessFormatFor(), and guessQualities().


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