SiStripConfigWriter

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
#ifndef SiStripConfigWriter_H
#define SiStripConfigWriter_H

/** \class SiStripConfigWriter
 * *
 *  Base class for Parsers used by DQM
 *
 *
 *  \author Suchandra Dutta
 */
#include "Utilities/Xerces/interface/Xerces.h"
#include <xercesc/framework/StdOutFormatTarget.hpp>
#include <xercesc/framework/LocalFileFormatTarget.hpp>

#include <xercesc/util/XMLString.hpp>
#include <xercesc/dom/DOMException.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
#include <xercesc/dom/DOM.hpp>

#include <iostream>
#include <string>
#include <vector>
#include <map>

class SiStripConfigWriter {
public:
  ///Creator
  SiStripConfigWriter();
  ///Destructor
  ~SiStripConfigWriter();
  ///Write XML file
  bool init(std::string main);
  void write(std::string fname);
  void createElement(std::string tag);
  void createElement(std::string tag, std::string name);
  void createChildElement(std::string tag, std::string name);
  void createChildElement(std::string tag, std::string name, std::string att_name, std::string att_val);
  void createChildElement(std::string tag,
                          std::string name,
                          std::string att_name1,
                          std::string att_val1,
                          std::string att_name2,
                          std::string att_val2);
  void createChildElement(std::string tag,
                          std::string name,
                          std::string att_name1,
                          std::string att_val1,
                          std::string att_name2,
                          std::string att_val2,
                          std::string att_name3,
                          std::string att_val3);

protected:
private:
  xercesc::DOMElement* theTopElement;
  xercesc::DOMElement* theLastElement;
  xercesc::DOMDocument* theDoc;
  xercesc::DOMLSSerializer* theDomWriter;
  xercesc::DOMLSOutput* theOutput;
};

#endif