QCIntgWriter.cpp

Go to the documentation of this file.
00001 //*****************************************************************************//
00002 //                                                                             //
00003 //   Copyright (c) 2001                                                        //
00004 //      INRIA                                                                  //
00005 //      54600 VILLERS LES NANCY                                                //
00006 //      France                                                                 //
00007 //                                                                             //
00008 //*****************************************************************************//
00009 //                                                                             //
00010 //               *** NOTICE OF PROPRIETARY INFORMATION ***                     //
00011 //                                                                             //
00012 // The information contained in this file is considered proprietary and the    //
00013 // exclusive property of  INRIA. This information may not be disclosed,        //
00014 // duplicated or used, in whole or in part, for  any purpose  whatsoever       //
00015 // without express written authorization from INRIA                            //
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 

Generated on Sat Jan 28 21:07:26 2006 for QC++ by  doxygen 1.4.4