CCalcRecConf.cpp

Go to the documentation of this file.
00001 #include <fstream>
00002 #include <algorithm>
00003  #include <CFatalException.h>
00004 #include "CCalcRecConf.h"
00005 using namespace std;
00006 void CCalcRecConf::GetData(string filename)
00007 {
00008 ifstream infile;
00009 infile.open(filename.c_str());
00010 infile.peek();
00011 if (!infile)
00012   throw CFatalException("No Configurationfile found !");
00013  GetData(infile);infile.close();
00014 }
00015 
00016 void CCalcRecConf::GetData(std::ifstream &instream)
00017 {
00018 CCalcRecConfLexer lexer(instream);
00019 CCalcRecConfParser parser(lexer);
00020 parser.configfile();
00021 cc= parser.cc;
00022 sigma= parser.sigma;
00023 shift= parser.shift;
00024 recmethod= parser.recmethod;
00025 normalize= parser.normalize;
00026 }
00027 
00028 void CCalcRecConf::WriteData(string filename)
00029 {
00030 ofstream confout(filename.c_str());
00031 WriteData(confout);}
00032 
00033 void CCalcRecConf::WriteData(std::ofstream &outstream)
00034 {
00035 outstream << "cc"  << "=" ;
00036 outstream << cc << endl;
00037 outstream << "sigma"  << "=" ;
00038 outstream << sigma << endl;
00039 outstream << "shift"  << "=" ;
00040 outstream << shift << endl;
00041 outstream << "recmethod"  << "=" ;
00042 outstream << recmethod << endl;
00043 outstream << "normalize"  << "=" ;
00044 outstream << (normalize ? "true" : "false") << endl;
00045 }
00046 

Generated on Tue May 4 16:52:14 2010 for GPLIB++ by  doxygen 1.5.8