CMS 3D CMS Logo

Classes | Functions
DDHtmlFormatter.h File Reference
#include <iostream>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include "DetectorDescription/RegressionTest/interface/DDErrorDetection.h"

Go to the source code of this file.

Classes

class  DDFrameGenerator
 
class  DDHtmlDetails
 
class  DDHtmlFormatter
 
class  DDHtmlLpDetails
 
class  DDHtmlMaDetails
 
class  DDHtmlRoDetails
 
class  DDHtmlSoDetails
 
class  DDHtmlSpDetails
 
class  DDNsGenerator
 

Functions

void dd_html_frameset (std::ostream &os)
 
void dd_html_menu (std::ostream &os)
 
void dd_html_menu_frameset (std::ostream &os)
 
void dd_html_ro ()
 
void dd_to_html (DDHtmlDetails &det)
 
std::ostream & operator<< (std::ostream &o, const DDHtmlFormatter &f)
 

Function Documentation

void dd_html_frameset ( std::ostream &  os)
void dd_html_menu ( std::ostream &  os)
void dd_html_menu_frameset ( std::ostream &  os)
void dd_html_ro ( )
void dd_to_html ( DDHtmlDetails det)

Definition at line 300 of file DDHtmlFormatter.cc.

References DDHtmlDetails::category(), gather_cfg::cout, DDHtmlDetails::details(), dir, f, alignmentValidation::fname, eostools::mkdir(), DDHtmlDetails::names(), mps_fire::result, and DDHtmlDetails::text().

Referenced by DDHtmlSpDetails::DDHtmlSpDetails().

301 {
302  cout << "---> dd_to_html() called with category=" << dtls.category() << endl;
303  const string & category = dtls.category();
304  const string & text = dtls.text();
305  ns_type & names = dtls.names();
306 
307  mkdir( category.c_str(), 0755 );
308 
309  // first the namespaces
310  string ns_fname = category + "/ns.html";
311  ofstream ns_file(ns_fname.c_str());
312  DDNsGenerator ns_gen(ns_file, text, "_list", names, "");
313  ns_gen.doit();
314  ns_file.close();
315 
316  // list all logical parts per namespace
317  ns_type::const_iterator it(names.begin()), ed(names.end());
318  for( ; it != ed; ++it ) {
319 
320  const string & ns = it->first;
321 
322  // create directories named like the namespaces
323  string dir = category + "/" + ns;
324  mkdir( dir.c_str(), 0755 );
325 
326  // create a html file listing all instances of a namespace
327  string fname = category + "/" + ns + "/list.html";
328  ofstream list_file(fname.c_str());
330  list_file << f.header(text)
331  << f.p("Instances in Namespace <b>" + ns + "</b><br>");
332  list_file << f.ul();
333  // loop over all instances of a single namespace
334  set<string>::const_iterator nit(it->second.begin()), ned(it->second.end());
335  for(; nit != ned; ++nit) {
336 
337  const string & nm = *nit;
338  string result_s = nm;
339 
340  // details for each instance
341  string d_fname = category + "/" + ns + "/" + nm + ".html";
342  ofstream detail_file(d_fname.c_str());
343  DDName an(nm,ns);
344  bool result = dtls.details(detail_file, an);
345 
346  if (!result) result_s = ">> ERROR: " + nm + " <<";
347  list_file << f.li(f.lnk(nm+".html", result_s, "_details"));
348 
349  }
350  list_file << f.ulEnd() << f.footer();
351  }
352 }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
const std::string names[nVars_]
double f[11][100]
string fname
main script
def mkdir(path)
Definition: eostools.py:250
dbl *** dir
Definition: mlp_gen.cc:35
std::map< std::string, std::set< std::string > > ns_type
std::ostream& operator<< ( std::ostream &  o,
const DDHtmlFormatter f 
)