#ifndef _QDATREADER_
#define _QDATREADER_
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstring>
#include "Rtypes.h"
#include "TString.h"
#include "QList.h"
using namespace std;
class QDatReader {
public:
QDatReader():fnsize(0),filename(NULL),file(),kwsize(0),keyword(NULL),currentline(0),firstkwline(-1){}
QDatReader(const QDatReader& rhs){
SetFilename(rhs.filename);
SetKeyword(rhs.keyword);
}
QDatReader(const Char_t* newfilename,const Char_t* newkeyword=NULL,Int_t newkwfield=0):fnsize(0),filename(NULL),file(),kwsize(0),keyword(newkeyword),currentline(0),firstkwline(-1){newkwfield=0; SetFilename(newfilename);}
virtual ~QDatReader(){}
const Char_t* GetFilename() const{ return filename;}
void SetFilename(const Char_t* newfilename)
{
filename=newfilename; file.open(filename,ios::in | ios::ate);
if(file.fail()){
cout << "<QDatReader::SetFilename> ERROR " << filename << " not found.\n";
throw 100;
}
fnsize=strlen(filename);
currentline = 0;
firstkwline = -1;
file.seekg(0);
}
const Char_t* GetKeyword() const{ return keyword;}
void SetKeyword(const Char_t* newkeyword=NULL,Int_t newkwfield=0)
{
newkwfield=0;
keyword=newkeyword;
if(keyword) kwsize=strlen(keyword);
else kwsize=0;
file.clear();
file.seekg(0);
currentline = 0;
firstkwline = -1;
}
QList<TString> Get(Int_t offset=0);
QList<QList<TString> > GetMany(Int_t offset=0,Int_t maxncommands=0);
void Clear(){
filename=NULL;
file.close();
keyword=NULL;
}
private:
Int_t fnsize;
const Char_t* filename;
ifstream file;
Int_t kwsize;
const Char_t* keyword;
Int_t currentline;
Int_t firstkwline;
ClassDef(QDatReader,1)
};
#endif
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.