Logo coherent WaveBurst  
Library Reference Guide
Logo
AddHtmlHeaderFooter.C
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Gabriele Vedovato
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 
20 void AddHtmlHeaderFooter(TString idir="cwb", bool use_doc_header=true) {
21 
24  Bool_t compile;
25  TString fName;
26 
27  if(!idir.EndsWith("/")) idir+="/";
28 
29  vector<TString> fileList = TB.getFileListFromDir(idir, ".html");
30 
31  char cmd[1024];
32  for(int i=0;i<fileList.size();i++) {
33  TString tmpFile = fileList[i];
34  tmpFile.ReplaceAll(".html",".html.tmp");
35  //cout << fileList[i].Data() << endl;
36  //cout << tmpFile.Data() << endl;
37  sprintf(cmd,"mv %s %s",fileList[i].Data(),tmpFile.Data());
38  //cout << cmd << endl;
39  gSystem->Exec(cmd);
40  sprintf(cmd,"cat $HOME_WAT/html/etc/html/header.html %s $HOME_WAT/html/etc/html/footer.html > %s",
41  tmpFile.Data(),fileList[i].Data());
42  gSystem->Exec(cmd);
43  sprintf(cmd,"rm %s",tmpFile.Data());
44  gSystem->Exec(cmd);
45  }
46 
47  exit(0);
48 }
49 
static vector< TString > getFileListFromDir(TString dir_name, TString endString="", TString beginString="", TString containString="", bool fast=false)
Definition: Toolbox.cc:5108
TString("c")
char comment[1024]
CWB::Toolbox TB
i drho i
void AddHtmlHeaderFooter(TString idir="cwb", bool use_doc_header=true)
cout<< "Starting reading output directory ..."<< endl;vector< TString > fileList
char cmd[1024]
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
char fName[256]
exit(0)