Logo coherent WaveBurst  
Library Reference Guide
Logo
cwb_dump_report_dir.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 // dump the list of labels of the report files in the report dir : used by the commands cwb_report
20 {
22 
23  vector<TString> repList = TB.getFileListFromDir(pp_dir, "M");
24 
26  www_rep.ReplaceAll(report_dir+TString("/"),"");
28  if(gSystem->Getenv("HOME")==NULL) {
29  cout << "Error : environment HOME is not defined!!!" << endl;exit(1);
30  } else {
31  home=TString(gSystem->Getenv("HOME"));
32  }
33  www_rep.ReplaceAll("~",home);
34  cout << endl;
35  cout << www_rep << endl;
36  vector<TString> wwwList = TB.getFileListFromDir(www_rep, "M");
37  cout << endl;
38  cout << " -----------------------------" << endl;
39  cout << " List of report directories" << endl;
40  cout << " -----------------------------" << endl;
41  cout << endl;
42 
43  for(int i=0;i<repList.size();i++) {
44  repList[i].ReplaceAll(pp_dir,"");
45  repList[i].ReplaceAll("/","");
46  bool published=false;
47  for(int j=0;j<wwwList.size();j++) {
48  wwwList[j].ReplaceAll(www_rep,"");
49  wwwList[j].ReplaceAll("/","");
50  if(wwwList[j].CompareTo(repList[i])==0) published=true;;
51  }
52  if(published) {
53  cout << " x : " << repList[i].Data() << endl;
54  } else {
55  cout << " - : " << repList[i].Data() << endl;
56  }
57  }
58  cout << endl;
59  cout << " -----------------------------" << endl;
60  cout << " x/- : published/not-published" << endl;
61  cout << endl;
62 
63  exit(0);
64 }
static vector< TString > getFileListFromDir(TString dir_name, TString endString="", TString beginString="", TString containString="", bool fast=false)
Definition: Toolbox.cc:5108
TString www_rep
TString home
TString("c")
char www_dir[512]
Definition: test_config1.C:157
cout<< endl;cout<< www_rep<< endl;vector< TString > wwwList
CWB::Toolbox TB
int j
Definition: cwb_net.C:28
char report_dir[512]
Definition: test_config1.C:149
i drho i
char data_label[512]
Definition: test_config1.C:160
vector< TString > repList
char pp_dir[512]
Definition: test_config1.C:155
exit(0)