CLmsConfig.cpp
Go to the documentation of this file.00001 #include <fstream>
00002 #include <algorithm>
00003 #include <CFatalException.h>
00004 #include "CLmsConfig.h"
00005 using namespace std;
00006 void CLmsConfig::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 CLmsConfig::GetData(std::ifstream &instream)
00017 {
00018 CLmsConfigLexer lexer(instream);
00019 CLmsConfigParser parser(lexer);
00020 parser.configfile();
00021 mu= parser.mu;
00022 filterlength= parser.filterlength;
00023 shift= parser.shift;
00024 secfactor= parser.secfactor;
00025 }
00026
00027 void CLmsConfig::WriteData(string filename)
00028 {
00029 ofstream confout(filename.c_str());
00030 WriteData(confout);}
00031
00032 void CLmsConfig::WriteData(std::ofstream &outstream)
00033 {
00034 outstream << "mu" << "=" ;
00035 outstream << mu << endl;
00036 outstream << "filterlength" << "=" ;
00037 outstream << filterlength << endl;
00038 outstream << "shift" << "=" ;
00039 outstream << shift << endl;
00040 outstream << "secfactor" << "=" ;
00041 outstream << secfactor << endl;
00042 }
00043