DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
DocumentHandler.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 #ifndef XML_DOCUMENTHANDLER_H
15 #define XML_DOCUMENTHANDLER_H
16 
17 // Framework include files
18 #include <XML/XMLElements.h>
19 
21 namespace dd4hep {
22 
24  namespace xml {
25 
26  // Forward declarations
27  class DocumentErrorHandle_tr;
28  class UriReader;
29 
31 
40  public:
44  virtual ~DocumentHandler();
46  static std::string defaultComment();
47  // Create new XML document by parsing empty xml buffer
48  Document create(const char* tag, const char* comment = 0) const;
49  // Create new XML document by parsing empty xml buffer
50  Document create(const std::string& tag, const std::string& comment) const;
52  virtual Document load(const std::string& fname) const;
54  virtual Document load(const std::string& fname, UriReader* reader) const;
56  virtual Document load(Handle_t base, const XmlChar* fname) const;
58  virtual Document load(Handle_t base, const XmlChar* fname, UriReader* reader) const;
60  virtual Document parse(const char* doc_string, size_t length) const;
62  virtual Document parse(const char* doc_string, size_t length, const char* sys_id, UriReader* reader) const;
64  virtual int output(Document doc, const std::string& fname) const;
65 
67  static int setMinimumPrintLevel(int level);
69  static std::string system_path(Handle_t base);
71  static std::string system_path(Handle_t base, const XmlChar* fname);
73  static std::string system_path(Handle_t base, const std::string& fname);
75  static std::string system_directory(Handle_t base);
77  static std::string system_directory(Handle_t base, const XmlChar* fname);
78 
79  };
80  }
81 } /* End namespace dd4hep */
82 #endif // XML_DOCUMENTHANDLER_H
dd4hep::xml::DocumentHandler::create
Document create(const char *tag, const char *comment=0) const
Create new XML document by parsing empty xml buffer.
Definition: DocumentHandler.cpp:681
dd4hep::xml::DocumentHandler::load
virtual Document load(const std::string &fname) const
Load XML file and parse it.
Definition: DocumentHandler.cpp:646
dd4hep::xml::Handle_t
Class to easily access the properties of single XmlElements.
Definition: XMLElements.h:380
dd4hep::xml
Namespace for the AIDA detector description toolkit supporting XML utilities.
Definition: ConditionsTags.h:27
dd4hep::xml::DocumentHandler::defaultComment
static std::string defaultComment()
Default comment string.
Definition: DocumentHandler.cpp:630
dd4hep::xml::UriReader
Class supporting to read data given a URI.
Definition: UriReader.h:35
dd4hep::xml::DocumentHandler::parse
virtual Document parse(const char *doc_string, size_t length) const
Parse a standalong XML string into a document.
Definition: DocumentHandler.cpp:656
dd4hep::xml::Document
Class supporting the basic functionality of an XML document.
Definition: XMLElements.h:697
dd4hep::xml::DocumentHandler::setMinimumPrintLevel
static int setMinimumPrintLevel(int level)
Set minimum print level.
Definition: DocumentHandler.cpp:623
dd4hep::xml::DocumentHandler::output
virtual int output(Document doc, const std::string &fname) const
Write xml document to output file (stdout if file name empty)
Definition: DocumentHandler.cpp:396
dd4hep::xml::DocumentHandler
Class supporting to read and parse XML documents.
Definition: DocumentHandler.h:39
dd4hep::xml::XmlChar
XERCES_XMLCH_T XmlChar
Use the definition from the autoconf header of Xerces:
Definition: config.h:53
XMLElements.h
dd4hep::xml::DocumentHandler::load
virtual Document load(Handle_t base, const XmlChar *fname, UriReader *reader) const
Load secondary XML file with relative addressing with respect to handle.
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::xml::DocumentHandler::system_directory
static std::string system_directory(Handle_t base)
System directory of a given XML entity.
Definition: DocumentHandler.cpp:674
dd4hep::xml::DocumentHandler::~DocumentHandler
virtual ~DocumentHandler()
Default destructor.
Definition: DocumentHandler.cpp:620
dd4hep::xml::DocumentHandler::DocumentHandler
DocumentHandler()
Default constructor.
Definition: DocumentHandler.cpp:617
dd4hep::xml::DocumentHandler::system_path
static std::string system_path(Handle_t base)
System ID of a given XML entity.
Definition: DocumentHandler.cpp:277