00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "QCIntgWriter.hpp"
00022
00023
00024
00028 QCIntgWriter::QCIntgWriter (void) : outputPath(""), filename(""), coutput(NULL)
00029 {}
00030
00031
00032
00036 QCIntgWriter:: ~QCIntgWriter (void)
00037 {
00038 closeFile();
00039 }
00040
00041
00042
00043
00047 void
00048 QCIntgWriter::openFile (const string name, const char *mode, const string path) {
00049
00050 string fullpath ( ((path.size() == 0) ? "" : path + PATH_SEPARATOR )+ name);
00054 if ( (coutput = fopen(fullpath.c_str(), mode)) ) {
00055 filename = name; outputPath = path;
00056
00057 } else {
00058
00060 cerr << "QCIntgWriter: openFile: file not found: " << fullpath <<endl;
00061 exit (EXIT_FAILURE);
00062 }
00063 }
00064
00065
00066
00067
00071 void
00072 QCIntgWriter::closeFile (void) {
00073
00074 if (coutput) {
00075
00076 fclose(coutput);
00077 coutput = NULL;
00078 filename = "";
00079
00080 }
00081 }
00082
00083