MakeInputConf.cpp

Go to the documentation of this file.
00001 #include <fstream>
00002 #include <algorithm>
00003  #include <CFatalException.h>
00004 #include "MakeInputConf.h"
00005 using namespace std;
00006 void MakeInputConf::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 MakeInputConf::GetData(std::ifstream &instream)
00017 {
00018 MakeInputConfLexer lexer(instream);
00019 MakeInputConfParser parser(lexer);
00020 parser.configfile();
00021 slowness= parser.slowness;
00022 omega= parser.omega;
00023 sigma= parser.sigma;
00024 shift= parser.shift;
00025 cc= parser.cc;
00026 poisson= parser.poisson;
00027 nlayers= parser.nlayers;
00028 outputbase= parser.outputbase;
00029 correlated= parser.correlated;
00030 dt= parser.dt;
00031 npts= parser.npts;
00032 }
00033 
00034 void MakeInputConf::WriteData(string filename)
00035 {
00036 ofstream confout(filename.c_str());
00037 WriteData(confout);}
00038 
00039 void MakeInputConf::WriteData(std::ofstream &outstream)
00040 {
00041 outstream << "slowness"  << "=" ;
00042 outstream << slowness << endl;
00043 outstream << "omega"  << "=" ;
00044 outstream << omega << endl;
00045 outstream << "sigma"  << "=" ;
00046 outstream << sigma << endl;
00047 outstream << "shift"  << "=" ;
00048 outstream << shift << endl;
00049 outstream << "cc"  << "=" ;
00050 outstream << cc << endl;
00051 outstream << "poisson"  << "=" ;
00052 outstream << poisson << endl;
00053 outstream << "nlayers"  << "=" ;
00054 outstream << nlayers << endl;
00055 outstream << "outputbase"  << "=" ;
00056 outstream << outputbase << endl;
00057 outstream << "correlated"  << "=" ;
00058 outstream << (correlated ? "true" : "false") << endl;
00059 outstream << "dt"  << "=" ;
00060 outstream << dt << endl;
00061 outstream << "npts"  << "=" ;
00062 outstream << npts << endl;
00063 }
00064 

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