![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /********************************************************************* 00002 ** Copyright (c) 2002 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: csvReader.h,v $ $Revision: 1.9 $ $State: Exp $ 00007 *********************************************************************/ 00008 00011 00012 #ifndef CSVReader_H 00013 #define CSVReader_H 00014 00015 #include "ngutil/ngutilDefines.h" 00016 #include <QtCore/QFile> 00017 #include <QtCore/QTextStream> 00018 00019 00021 class DT_DLL_ngutil DtCSVReader 00022 { 00023 00024 public: 00025 DtCSVReader( const QString & filename ); 00026 virtual ~DtCSVReader(); 00027 00029 virtual bool readLine(); 00030 00033 virtual QString stringVar( int start, int end ) const; 00034 00038 virtual int intVar( int pos, bool * validNum ) const; 00039 00040 virtual void setSeparator(char newSeparator); 00041 virtual char separator(); 00042 00044 virtual int numColumns() const; 00045 00046 const QString& currLine() const; 00047 00048 protected: 00049 char mySeparator; 00050 QFile myFile; 00051 QTextStream myTS; 00052 bool myValidFile; 00053 QString myCurrLine; 00054 }; 00055 00056 inline const QString& DtCSVReader::currLine() const 00057 { 00058 return myCurrLine; 00059 } 00060 00061 #endif //CSVReader_H 00062