00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "QCIntgReader.hpp"
00023
00024
00025
00029 QCIntgReader::QCIntgReader (void) :
00030 inputPath(""),
00031 filename(""),
00032 cinput(NULL)
00033 {}
00034
00035
00036
00040 QCIntgReader::~QCIntgReader (void) {
00041
00042 closeFile();
00043 }
00044
00045
00046
00047
00048
00052 void
00053 QCIntgReader::openFile (const string name, const char * mode,const string path) {
00054
00055 string fullpath ( ((path.size() == 0) ? "" : path + PATH_SEPARATOR )+ name);
00056
00062 if ( (cinput = fopen(fullpath.c_str(), mode)) ) {
00063
00064 filename = name;
00065 inputPath = path;
00066
00067 } else {
00068
00070 cerr << "QCIntgReader: openFile: file not found: " << fullpath <<endl;
00071 exit (EXIT_FAILURE);
00072 }
00073 }
00074
00075
00076
00077
00081 void
00082 QCIntgReader::closeFile (void) {
00083
00084 if (cinput) {
00085
00086 fclose(cinput);
00087 cinput = NULL;
00088 filename = "";
00089 }
00090
00091 }
00092
00093
00094