otsdaq  3.03.00
ots::XmlDocument Class Reference

Note that XmlDocument functionality is extended by HttpXmlDocument class. More...

#include <otsdaq/XmlUtilities/XmlDocument.h>

+ Inheritance diagram for ots::XmlDocument:
+ Collaboration diagram for ots::XmlDocument:

Public Member Functions

 XmlDocument (const std::string &rootName="ROOT")
 
 XmlDocument (const XmlDocument &doc)
 
XmlDocumentoperator= (const XmlDocument &doc)
 
xercesc::DOMElement * createChildElement (const std::string &childClass, xercesc::DOMElement *parent)
 
xercesc::DOMElement * addAttributeToNode (const std::string &attributeName, const std::string &attributeValue, xercesc::DOMElement *node)
 
xercesc::DOMElement * addTextElementToParent (const std::string &childName, const std::string &childText, xercesc::DOMElement *parent)
 
xercesc::DOMElement * addTextElementToParent (const std::string &childName, const std::string &childText, const std::string &parentName, unsigned int parentIndex=0)
 
void saveXmlDocument (const std::string &filePath)
 
void recursiveRemoveChild (xercesc::DOMElement *childEl, xercesc::DOMElement *parentEl)
 
bool loadXmlDocument (const std::string &filePath)
 
void outputXmlDocument (std::ostringstream *out, bool dispStdOut=false)
 
void makeDirectoryBinaryTree (const std::string &name, const std::string &rootPath, int indent, xercesc::DOMElement *anchorNode)
 
xercesc::DOMElement * populateBinaryTreeNode (xercesc::DOMElement *anchorNode, const std::string &name, int indent, bool isLeaf)
 
void setAnchors (const std::string &fSystemPath, const std::string &fRootPath)
 
void setDocument (xercesc::DOMDocument *doc)
 
void setDarioStyle (bool darioStyle)
 Used by developer Dario Menasce for alternative XML requests at web user interface.
 
void setRootPath (const std::string &rootPath)
 
xercesc::DOMElement * getRootElement ()
 

Protected Member Functions

void copyDocument (const xercesc::DOMDocument *toCopy, xercesc::DOMDocument *copy)
 
void recursiveElementCopy (const xercesc::DOMElement *toCopy, xercesc::DOMElement *copy)
 
void initDocument (void)
 
void initPlatform (void)
 
void terminatePlatform (void)
 
void recursiveOutputXmlDocument (xercesc::DOMElement *currEl, std::ostringstream *out, bool dispStdOut=false, const std::string &tabStr="")
 

Protected Attributes

xercesc::DOMImplementation * theImplementation_
 
xercesc::DOMDocument * theDocument_
 
xercesc::DOMElement * rootElement_
 
const std::string rootTagName_
 
xercesc::DOMDocument * doc
 
xercesc::DOMElement * rootElem
 
DIR * dir
 
struct dirent * entry
 
int lastIndent
 
int errorCode
 
int level
 
std::string fullPath
 
std::string fullFPath
 
std::stringstream ss_
 
std::map< int, xercesc::DOMElement * > theNodes_
 
std::map< int, std::string > theNames_
 
std::vector< std::string > hierarchyPaths_
 
xercesc::DOMImplementation * impl
 
xercesc::DOMLSSerializer * pSerializer
 
xercesc::DOMConfiguration * pDomConfiguration
 
bool darioXMLStyle_
 
std::string fSystemPath_
 
std::string fRootPath_
 
std::string fFoldersPath_
 
std::string fFileName_
 
std::string fThisFolderPath_
 
int indent_
 
std::map< bool, std::string > isALeaf_
 

Detailed Description

Note that XmlDocument functionality is extended by HttpXmlDocument class.

Definition at line 35 of file XmlDocument.h.

Constructor & Destructor Documentation

◆ XmlDocument()

XmlDocument::XmlDocument ( const std::string &  rootName = "ROOT")

Definition at line 46 of file XmlDocument.cc.

Member Function Documentation

◆ addTextElementToParent() [1/2]

xercesc::DOMElement * XmlDocument::addTextElementToParent ( const std::string &  childName,
const std::string &  childText,
const std::string &  parentName,
unsigned int  parentIndex = 0 
)

addTextElementToParent add to parent by instance number of parent name returns pointer to element that is added

Definition at line 290 of file XmlDocument.cc.

◆ addTextElementToParent() [2/2]

xercesc::DOMElement * XmlDocument::addTextElementToParent ( const std::string &  childName,
const std::string &  childText,
xercesc::DOMElement *  parent 
)

addTextElementToParent add to parent by pointer to parent returns pointer to element that is added

Definition at line 244 of file XmlDocument.cc.

◆ copyDocument()

void XmlDocument::copyDocument ( const xercesc::DOMDocument *  toCopy,
xercesc::DOMDocument *  copy 
)
protected

Definition at line 310 of file XmlDocument.cc.

◆ outputXmlDocument()

void XmlDocument::outputXmlDocument ( std::ostringstream *  out,
bool  dispStdOut = false 
)

XmlDocument::outputXmlDocument recurse through XML theDocument_ and std out and output to stream parameter if not null

Definition at line 348 of file XmlDocument.cc.

◆ recursiveOutputXmlDocument()

void XmlDocument::recursiveOutputXmlDocument ( xercesc::DOMElement *  currEl,
std::ostringstream *  out,
bool  dispStdOut = false,
const std::string &  tabStr = "" 
)
protected

XmlDocument::recursiveOutputXmlDocument recursively printout XML theDocument_ to std out and output stream if not null

Definition at line 358 of file XmlDocument.cc.

◆ recursiveRemoveChild()

void XmlDocument::recursiveRemoveChild ( xercesc::DOMElement *  childEl,
xercesc::DOMElement *  parentEl 
)

XmlDocument::recursiveRemoveChild remove child and all of child's sub-tree from parent

Definition at line 453 of file XmlDocument.cc.

◆ saveXmlDocument()

void XmlDocument::saveXmlDocument ( const std::string &  filePath)

XmlDocument::saveXmlDocument wrapper for private outputXML Warning: filePath must be accessible or program will crash!

Definition at line 473 of file XmlDocument.cc.


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