QCIntgReader.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 
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 

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