ModuleDataFile.cpp

00001 #include "ModuleDataFile.h"
00002 #include "Sct/IoExceptions.h"
00003 #include "Sct/Env.h"
00004 
00005 namespace SctTest {
00006 ModuleDataFile::ModuleDataFile(string fileName) : file(fileName.c_str()) {
00007     if (!file.is_open()) throw Sct::FileException(fileName, "Cannot open file", __FILE__, __LINE__);
00008 }
00009 
00010 bool ModuleDataFile::hasMoreRecords() {
00011     if (file.eof() || !file.is_open()) return false;
00012     return true;
00013 }
00014 
00015 ModuleDataRecord ModuleDataFile::getNextRecord() {
00016     ModuleDataRecord r;
00017     file >> r.serialNumber >> r.testName >> r.dataPath >> r.runNumber >> r.scanNumber >> std::ws;
00018     r.dataPath = Sct::Env::substituteVariables(r.dataPath);
00019     return r;
00020 }
00021 
00022 }

Generated on Mon Feb 6 14:01:23 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6