tdaq-develop-2025-02-12
ots::HttpXmlDocument Class Reference
Inheritance diagram for ots::HttpXmlDocument:
ots::XmlDocument

Public Member Functions

 HttpXmlDocument (std::string cookieCode="", std::string displayName="")
 
 HttpXmlDocument (const HttpXmlDocument &doc)
 
HttpXmlDocumentoperator= (const HttpXmlDocument &doc)
 
void setHeader (std::string cookieCode="", std::string displayName="")
 
xercesc::DOMElement * getRootDataElement (void)
 
xercesc::DOMElement * addTextElementToData (const std::string &field, const std::string &value="")
 
template<class T >
xercesc::DOMElement * addNumberElementToData (const std::string &field, const T &value)
 
xercesc::DOMElement * addBinaryStringToData (const std::string &field, const std::string &binary)
 
template<class T >
xercesc::DOMElement * addNumberElementToParent (const std::string &field, const T &value, xercesc::DOMElement *parent)
 
void copyDataChildren (HttpXmlDocument &document)
 
std::string getMatchingValue (const std::string &field, const unsigned int occurance=0)
 
void getAllMatchingValues (const std::string &field, std::vector< std::string > &retVec)
 
xercesc::DOMElement * getMatchingElement (const std::string &field, const unsigned int occurance=0)
 
xercesc::DOMElement * getMatchingElementInSubtree (xercesc::DOMElement *currEl, const std::string &field, const unsigned int occurance=0)
 
void getAllMatchingElements (const std::string &field, std::vector< xercesc::DOMElement * > &retVec)
 
void outputXmlDocument (std::ostringstream *out, bool dispStdOut=false, bool allowWhiteSpace=false)
 
bool loadXmlDocument (const std::string &filePath)
 
unsigned int getChildrenCount (xercesc::DOMElement *parent=0)
 
void removeDataElement (unsigned int dataChildIndex=0)
 default to first child More...
 
- Public Member Functions inherited from ots::XmlDocument
 XmlDocument (const std::string &rootName="ROOT")
 
 XmlDocument (const XmlDocument &doc)
 
XmlDocumentoperator= (const XmlDocument &doc)
 
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)
 
void setRootPath (const std::string &rootPath)
 

Public Attributes

std::stringstream dataSs_
 

Additional Inherited Members

- Protected Member Functions inherited from ots::XmlDocument
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 inherited from ots::XmlDocument
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

Definition at line 14 of file HttpXmlDocument.h.

Constructor & Destructor Documentation

◆ HttpXmlDocument()

HttpXmlDocument::HttpXmlDocument ( std::string  cookieCode = "",
std::string  displayName = "" 
)

HttpXmlDocument::HttpXmlDocument Constructor to initialize XML theDocument_ for ots. The XML theDocument_ can be written to xdaq output stream to client

theDocument_ result: <ROOT> <HEADER> –optional with value <CookieCode>, <DisplayName> added in constructor <DATA> –optional data elements with value and any field name

Definition at line 54 of file HttpXmlDocument.cc.

Member Function Documentation

◆ copyDataChildren()

void HttpXmlDocument::copyDataChildren ( HttpXmlDocument document)

HttpXmlDocument::addXmlData Append <DATA> from xmldoc to this XML doc

Definition at line 216 of file HttpXmlDocument.cc.

◆ getAllMatchingElements()

void HttpXmlDocument::getAllMatchingElements ( const std::string &  field,
std::vector< xercesc::DOMElement * > &  retVec 
)

HttpXmlDocument::getAllMatchingElements returns all of the values found for the field in a vector if none found vector will have size 0

Definition at line 549 of file HttpXmlDocument.cc.

◆ getAllMatchingValues()

void HttpXmlDocument::getAllMatchingValues ( const std::string &  field,
std::vector< std::string > &  retVec 
)

HttpXmlDocument::getAllMatchingValues returns all of the values found for the field in a vector if none found vector will have size 0

Definition at line 416 of file HttpXmlDocument.cc.

◆ getChildrenCount()

unsigned int HttpXmlDocument::getChildrenCount ( xercesc::DOMElement *  parent = 0)

HttpXmlDocument::getChildrenCount get count of children ignoring text nodes.

Definition at line 167 of file HttpXmlDocument.cc.

◆ getMatchingElement()

xercesc::DOMElement * HttpXmlDocument::getMatchingElement ( const std::string &  field,
const unsigned int  occurance = 0 
)

HttpXmlDocument::getMatchingElement returns the element for field found occurance number of times returns null if field was not found

Definition at line 448 of file HttpXmlDocument.cc.

◆ getMatchingElementInSubtree()

xercesc::DOMElement * HttpXmlDocument::getMatchingElementInSubtree ( xercesc::DOMElement *  parentEl,
const std::string &  field,
const unsigned int  occurance = 0 
)

HttpXmlDocument::getMatchingElementInSubtree returns the element for field found occurance number of times within the subtree specified by parentEl returns null if field was not found

Definition at line 460 of file HttpXmlDocument.cc.

◆ getMatchingValue()

std::string HttpXmlDocument::getMatchingValue ( const std::string &  field,
const unsigned int  occurance = 0 
)

HttpXmlDocument::getMatchingValue returns the value for field found occurance number of times returns empty std::string "" if field was not found

Definition at line 367 of file HttpXmlDocument.cc.

◆ loadXmlDocument()

bool HttpXmlDocument::loadXmlDocument ( const std::string &  filePath)

HttpXmlDocument::StringMacros::escapeString convert quotes to html quote characters &apos = ' and &quot = " remove new line characters and remove white space (so that read from file white space artifact removed) loadXmlDocument returns false if file does not exist

Definition at line 611 of file HttpXmlDocument.cc.

◆ outputXmlDocument()

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

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

Definition at line 236 of file HttpXmlDocument.cc.

◆ removeDataElement()

void HttpXmlDocument::removeDataElement ( unsigned int  dataChildIndex = 0)

default to first child

HttpXmlDocument::removeDataElement Remove child and child's sub-tree from dataElement. The child is identified with dataChildIndex.

Definition at line 190 of file HttpXmlDocument.cc.


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