DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Member Functions | Static Public Member Functions | List of all members
dd4hep::xml::DocumentHandler Class Reference

Class supporting to read and parse XML documents. More...

#include <DocumentHandler.h>

Public Member Functions

 DocumentHandler ()
 Default constructor. More...
 
virtual ~DocumentHandler ()
 Default destructor. More...
 
Document create (const char *tag, const char *comment=0) const
 Create new XML document by parsing empty xml buffer. More...
 
Document create (const std::string &tag, const std::string &comment) const
 
virtual Document load (const std::string &fname) const
 Load XML file and parse it. More...
 
virtual Document load (const std::string &fname, UriReader *reader) const
 Load XML file and parse it using URI resolver to read data. More...
 
virtual Document load (Handle_t base, const XmlChar *fname) const
 Load secondary XML file with relative addressing with respect to handle. More...
 
virtual Document load (Handle_t base, const XmlChar *fname, UriReader *reader) const
 Load secondary XML file with relative addressing with respect to handle. More...
 
virtual Document parse (const char *doc_string, size_t length) const
 Parse a standalong XML string into a document. More...
 
virtual Document parse (const char *doc_string, size_t length, const char *sys_id, UriReader *reader) const
 Parse a standalong XML string into a document using URI resolver to read data. More...
 
virtual int output (Document doc, const std::string &fname) const
 Write xml document to output file (stdout if file name empty) More...
 

Static Public Member Functions

static std::string defaultComment ()
 Default comment string. More...
 
static int setMinimumPrintLevel (int level)
 Set minimum print level. More...
 
static std::string system_path (Handle_t base)
 System ID of a given XML entity. More...
 
static std::string system_path (Handle_t base, const XmlChar *fname)
 System ID of a new XML entity in the same directory as base. More...
 
static std::string system_path (Handle_t base, const std::string &fname)
 System ID of a new XML entity in the same directory as base. More...
 
static std::string system_directory (Handle_t base)
 System directory of a given XML entity. More...
 
static std::string system_directory (Handle_t base, const XmlChar *fname)
 System directory of a new XML entity in the same directory as base. More...
 

Detailed Description

Class supporting to read and parse XML documents.

Wrapper object around the document parser. Supports both, XercesC and TiXml.

Author
M.Frank
Version
1.0

Definition at line 39 of file DocumentHandler.h.

Constructor & Destructor Documentation

◆ DocumentHandler()

DocumentHandler::DocumentHandler ( )

Default constructor.

Default constructor of a document handler using TiXml.

Definition at line 617 of file DocumentHandler.cpp.

◆ ~DocumentHandler()

DocumentHandler::~DocumentHandler ( )
virtual

Default destructor.

Default destructor of a document handler using TiXml.

Definition at line 620 of file DocumentHandler.cpp.

Member Function Documentation

◆ create() [1/2]

Document DocumentHandler::create ( const char *  tag,
const char *  comment = 0 
) const

Create new XML document by parsing empty xml buffer.

Definition at line 681 of file DocumentHandler.cpp.

◆ create() [2/2]

Document DocumentHandler::create ( const std::string &  tag,
const std::string &  comment 
) const

Definition at line 694 of file DocumentHandler.cpp.

◆ defaultComment()

std::string DocumentHandler::defaultComment ( )
static

Default comment string.

Definition at line 630 of file DocumentHandler.cpp.

◆ load() [1/4]

Document DocumentHandler::load ( const std::string &  fname) const
virtual

Load XML file and parse it.

Definition at line 646 of file DocumentHandler.cpp.

◆ load() [2/4]

Document DocumentHandler::load ( const std::string &  fname,
UriReader reader 
) const
virtual

Load XML file and parse it using URI resolver to read data.

Definition at line 339 of file DocumentHandler.cpp.

◆ load() [3/4]

Document DocumentHandler::load ( Handle_t  base,
const XmlChar fname 
) const
virtual

Load secondary XML file with relative addressing with respect to handle.

Definition at line 651 of file DocumentHandler.cpp.

◆ load() [4/4]

virtual Document dd4hep::xml::DocumentHandler::load ( Handle_t  base,
const XmlChar fname,
UriReader reader 
) const
virtual

Load secondary XML file with relative addressing with respect to handle.

◆ output()

int DocumentHandler::output ( Document  doc,
const std::string &  fname 
) const
virtual

Write xml document to output file (stdout if file name empty)

Definition at line 396 of file DocumentHandler.cpp.

◆ parse() [1/2]

Document DocumentHandler::parse ( const char *  doc_string,
size_t  length 
) const
virtual

Parse a standalong XML string into a document.

Definition at line 656 of file DocumentHandler.cpp.

◆ parse() [2/2]

Document DocumentHandler::parse ( const char *  doc_string,
size_t  length,
const char *  sys_id,
UriReader reader 
) const
virtual

Parse a standalong XML string into a document using URI resolver to read data.

Parse a standalong XML string into a document.

Definition at line 385 of file DocumentHandler.cpp.

◆ setMinimumPrintLevel()

int DocumentHandler::setMinimumPrintLevel ( int  level)
static

Set minimum print level.

Definition at line 623 of file DocumentHandler.cpp.

◆ system_directory() [1/2]

std::string DocumentHandler::system_directory ( Handle_t  base)
static

System directory of a given XML entity.

Definition at line 674 of file DocumentHandler.cpp.

◆ system_directory() [2/2]

std::string DocumentHandler::system_directory ( Handle_t  base,
const XmlChar fname 
)
static

System directory of a new XML entity in the same directory as base.

System directory of a given XML entity.

Definition at line 667 of file DocumentHandler.cpp.

◆ system_path() [1/3]

std::string DocumentHandler::system_path ( Handle_t  base)
static

System ID of a given XML entity.

Definition at line 277 of file DocumentHandler.cpp.

◆ system_path() [2/3]

std::string DocumentHandler::system_path ( Handle_t  base,
const std::string &  fname 
)
static

System ID of a new XML entity in the same directory as base.

System ID of a given XML entity.

Definition at line 264 of file DocumentHandler.cpp.

◆ system_path() [3/3]

std::string DocumentHandler::system_path ( Handle_t  base,
const XmlChar fname 
)
static

System ID of a new XML entity in the same directory as base.

System ID of a given XML entity.

Definition at line 661 of file DocumentHandler.cpp.


The documentation for this class was generated from the following files: