DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DocumentHandler.h
Go to the documentation of this file.
1 // $Id$
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 
15 #ifndef DD4HEP_XML_DOCUMENTHANDLER_H
16 #define DD4HEP_XML_DOCUMENTHANDLER_H
17 
18 // Framework include files
19 #include "XML/XMLElements.h"
20 #include "DD4hep/Memory.h"
21 
23 namespace DD4hep {
24 
26  namespace XML {
27 
28  // Forward declarations
29  class DocumentErrorHandler;
30  class UriReader;
31 
33 
42  public:
46  virtual ~DocumentHandler();
47  // Create new XML document by parsing empty xml buffer
48  Document create(const char* tag, const char* comment = 0) const;
50  virtual Document load(const std::string& fname) const;
52  virtual Document load(const std::string& fname, UriReader* reader) const;
54  virtual Document load(Handle_t base, const XmlChar* fname) const;
56  virtual Document load(Handle_t base, const XmlChar* fname, UriReader* reader) const;
58  virtual Document parse(const char* doc_string, size_t length) const;
60  virtual Document parse(const char* doc_string, size_t length, const char* sys_id, UriReader* reader) const;
62  virtual int output(Document doc, const std::string& fname) const;
63 
65  static std::string system_path(Handle_t base);
67  static std::string system_path(Handle_t base, const XmlChar* fname);
69  static std::string system_path(Handle_t base, const std::string& fname);
71  static std::string system_directory(Handle_t base);
73  static std::string system_directory(Handle_t base, const XmlChar* fname);
74 
75  };
76  }
77 } /* End namespace DD4hep */
78 #endif /* DD4HEP_XML_DOCUMENTHANDLER_H */
Document create(const char *tag, const char *comment=0) const
Create new XML document by parsing empty xml buffer.
virtual int output(Document doc, const std::string &fname) const
Write xml document to output file (stdout if file name empty)
virtual Document load(const std::string &fname) const
Load XML file and parse it.
virtual Document parse(const char *doc_string, size_t length) const
Parse a standalong XML string into a document.
Class supporting to read data given a URI.
Definition: UriReader.h:36
DocumentHandler()
Default constructor.
unsigned short XmlChar
Definition: config.h:43
virtual ~DocumentHandler()
Default destructor.
Class to easily access the properties of single XmlElements.
Definition: XMLElements.h:361
Class supporting the basic functionality of an XML document.
Definition: XMLElements.h:617
static std::string system_directory(Handle_t base)
System directory of a given XML entity.
static std::string system_path(Handle_t base)
System ID of a given XML entity.
Class supporting to read and parse XML documents.