#include "G4Svc/ProjectMessenger.h"
#include "G4Svc/Goofy.h"
#include "G4UIcommand.hh"
#include "G4UImanager.hh"
#include "FadsPackageLoader/PackageLoader.h"
#include <string>
#include <fstream.h>
Go to the source code of this file.
Functions | |
std::string | getLine (ifstream &in) |
void | parseTemplate (std::string dir, std::string filename, std::string dname) |
std::string getLine | ( | ifstream & | in | ) |
Definition at line 12 of file ProjectMessenger.cpp.
References s, and deljobs::string.
Referenced by parseTemplate().
00013 { 00014 char buffer[200]; 00015 if (in.getline(buffer,200)) 00016 { 00017 std::string s=buffer; 00018 return s; 00019 } 00020 else return "eof"; 00021 }
void parseTemplate | ( | std::string | dir, | |
std::string | filename, | |||
std::string | dname | |||
) |
Definition at line 23 of file ProjectMessenger.cpp.
References EvtCyclic3::c_str(), getLine(), genRecEmupikp::i, RealDBUtil::npos, and deljobs::string.
Referenced by ProjectMessenger::SetNewValue().
00024 { 00025 std::string outname=dname; 00026 std::string outfile=dir+outname+".temp"; 00027 ofstream out(outfile.c_str()); 00028 ifstream in((dir+filename).c_str()); 00029 00030 unsigned int i=0; 00031 std::string buffer; 00032 while ((buffer=getLine(in))!="eof") 00033 { 00034 while ((i=buffer.find("@NAME"))!=std::string::npos) 00035 { 00036 if (i>0) buffer.replace(i,5,outname); 00037 } 00038 out<<buffer<<std::endl; 00039 } 00040 }