BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
ProjectMessenger.cpp File Reference
#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)
 

Function Documentation

◆ getLine()

std::string getLine ( ifstream &  in)

Definition at line 12 of file ProjectMessenger.cpp.

13{
14 char buffer[200];
15 if (in.getline(buffer,200))
16 {
17 std::string s=buffer;
18 return s;
19 }
20 else return "eof";
21}
XmlRpcServer s
Definition: HelloServer.cpp:11

Referenced by parseTemplate().

◆ parseTemplate()

void parseTemplate ( std::string  dir,
std::string  filename,
std::string  dname 
)

Definition at line 23 of file ProjectMessenger.cpp.

24{
25 std::string outname=dname;
26 std::string outfile=dir+outname+".temp";
27 ofstream out(outfile.c_str());
28 ifstream in((dir+filename).c_str());
29
30 unsigned int i=0;
31 std::string buffer;
32 while ((buffer=getLine(in))!="eof")
33 {
34 while ((i=buffer.find("@NAME"))!=std::string::npos)
35 {
36 if (i>0) buffer.replace(i,5,outname);
37 }
38 out<<buffer<<std::endl;
39 }
40}
std::string getLine(ifstream &in)
char * c_str(Index i)
Definition: EvtCyclic3.cc:252
std::ifstream ifstream
Definition: bpkt_streams.h:44
std::ofstream ofstream
Definition: bpkt_streams.h:42

Referenced by ProjectMessenger::SetNewValue().