VR-Forces 4.1.1 Class Documentation
List of all members | Public Member Functions | Protected Attributes
DtCSVReader Class Reference

Inputs data from a comma delimited file format. More...

Public Member Functions

 DtCSVReader (const QString &filename)
virtual ~DtCSVReader ()
virtual bool readLine ()
 Read the next line of the file. Returns false if no more lines.
virtual QString stringVar (int start, int end) const
 Returns one or more fields as a string.
virtual int intVar (int pos, bool *validNum) const
 Returns the field number "pos" as an integer.
virtual void setSeparator (char newSeparator)
virtual char separator ()
virtual int numColumns () const
 Returns the number of columns on the line, given the separator.
const QString & currLine () const

Protected Attributes

char mySeparator
QFile myFile
QTextStream myTS
bool myValidFile
QString myCurrLine

Detailed Description

Inputs data from a comma delimited file format.

Constructor & Destructor Documentation

DtCSVReader::DtCSVReader ( const QString &  filename)
virtual DtCSVReader::~DtCSVReader ( )
virtual

Member Function Documentation

virtual bool DtCSVReader::readLine ( )
virtual

Read the next line of the file. Returns false if no more lines.

virtual QString DtCSVReader::stringVar ( int  start,
int  end 
) const
virtual

Returns one or more fields as a string.

See QTextStream::section() for details.

virtual int DtCSVReader::intVar ( int  pos,
bool validNum 
) const
virtual

Returns the field number "pos" as an integer.

validNum indicates if the conversion to an integer was possible.

virtual void DtCSVReader::setSeparator ( char  newSeparator)
virtual
virtual char DtCSVReader::separator ( )
virtual
virtual int DtCSVReader::numColumns ( ) const
virtual

Returns the number of columns on the line, given the separator.

const QString & DtCSVReader::currLine ( ) const
inline

References myCurrLine.

Member Data Documentation

char DtCSVReader::mySeparator
protected
QFile DtCSVReader::myFile
protected
QTextStream DtCSVReader::myTS
protected
bool DtCSVReader::myValidFile
protected
QString DtCSVReader::myCurrLine
protected

Referenced by currLine().


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

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)