CMS 3D CMS Logo

Classes | Functions

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/DetectorDescription/RegressionTest/interface/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 290 of file DDHtmlFormatter.cc.

References DDHtmlDetails::category(), python::rootplot::argparse::category, gather_cfg::cout, DDHtmlDetails::details(), dir, f, alignmentValidation::fname, DDHtmlDetails::names(), h::names, query::result, DDHtmlDetails::text(), and runonSM::text.

{
  cout << "---> dd_to_html() called with category=" << dtls.category() << endl;
  const string & category = dtls.category();
  const string & text     = dtls.text();
  ns_type & names         = dtls.names();
  
  mkdir( category.c_str(), 0755 );
  
  // first the namespaces
  string ns_fname = category + "/ns.html";
  ofstream ns_file(ns_fname.c_str());
  DDNsGenerator ns_gen(ns_file, text, "_list", names, "");  
  ns_gen.doit();
  ns_file.close();
  
  // list all logical parts per namespace
  ns_type::const_iterator it(names.begin()), ed(names.end());
  for( ; it != ed; ++it ) {
    
    const string & ns = it->first;
    
    // create directories named like the namespaces
    string dir = category + "/" + ns;
    mkdir( dir.c_str(), 0755 );

    // create a html file listing all instances of a namespace
    string fname = category + "/" + ns + "/list.html";
    ofstream list_file(fname.c_str());
    DDHtmlFormatter f;
    list_file << f.header(text)
              << f.p("Instances in Namespace <b>" + ns + "</b><br>");
    list_file << f.ul();
    // loop over all instances of a single namespace
    set<string>::const_iterator nit(it->second.begin()), ned(it->second.end());
    for(; nit != ned; ++nit) {

      const string & nm = *nit;
      string result_s = nm;

      // details for each instance 
      string d_fname = category + "/" + ns + "/" + nm + ".html";
      ofstream detail_file(d_fname.c_str());
      DDName an(nm,ns);
      bool result = dtls.details(detail_file, an);

      if (!result) result_s = ">> ERROR: " + nm + " <<";
      list_file << f.li(f.lnk(nm+".html", result_s, "_details"));          
      
    }
    list_file << f.ulEnd() << f.footer();
  }
}
std::ostream& operator<< ( std::ostream &  o,
const DDHtmlFormatter f 
)