All Classes Namespaces Functions Variables Typedefs Enumerations
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
MBXMLUtils::DOMElementWrapper< DOMElementType > Class Template Reference

Helper class for extending DOMElement (use the function E(...)). More...

#include <dom.h>

Public Member Functions

 DOMElementWrapper (DOMElementType *me_)
 Wrap DOMElement to my special element.
 
FQN getTagName () const
 Get full qualified tag name.
 
const xercesc::DOMElement * getFirstElementChildNamed (const FQN &name) const
 Get first child element of the specified full qualified name.
 
xercesc::DOMElement * getFirstElementChildNamed (const FQN &name)
 Get first child element of the specified full qualified name.
 
const
xercesc::DOMProcessingInstruction * 
getFirstProcessingInstructionChildNamed (const std::string &target) const
 Get first child processing instruction of the specified target.
 
xercesc::DOMProcessingInstruction * getFirstProcessingInstructionChildNamed (const std::string &target)
 Get first child processing instruction of the specified target.
 
const xercesc::DOMText * getFirstTextChild () const
 Get first child text.
 
xercesc::DOMText * getFirstTextChild ()
 Get first child text.
 
bool isDerivedFrom (const FQN &base) const
 
boost::filesystem::path getOriginalFilename (bool skipThis=false, const xercesc::DOMElement *&found=DOMElementWrapper< DOMElementType >::dummyArg) const
 
void setOriginalFilename ()
 
boost::filesystem::path convertPath (const boost::filesystem::path &relPath) const
 
int getLineNumber () const
 
int getEmbedCountNumber () const
 
void setEmbedCountNumber (int embedCount)
 
int getOriginalElementLineNumber () const
 Get the line number of the original element.
 
void setOriginalElementLineNumber (int lineNr)
 Set the line number of the original element.
 
std::string getAttribute (const FQN &name) const
 Get attribute named name.
 
const xercesc::DOMAttr * getAttributeNode (const FQN &name) const
 Get attribute node named name.
 
xercesc::DOMAttr * getAttributeNode (const FQN &name)
 Get attribute node named name.
 
void setAttribute (const FQN &name, const std::string &value)
 Set attribute.
 
bool hasAttribute (const FQN &name) const
 check if this element has a attibute named name.
 
void removeAttribute (const FQN &name)
 remove from this element the attibute named name.
 
void workaroundDefaultAttributesOnImportNode ()
 Workaround: convert default attributes to normal attributes (must be used before importNode to also import default attributes)
 
std::conditional< std::is_same
< DOMElementType, const
xercesc::DOMElement >::value,
const DOMElementWrapper
*, DOMElementWrapper * >::type 
operator-> ()
 Treat this object as a pointer (like DOMElement*)
 
template<>
const DOMElement * dummyArg
 
template<>
const DOMElement * dummyArg
 

Static Public Attributes

static const xercesc::DOMElement * dummyArg
 

Private Attributes

DOMElementType * me
 

Detailed Description

template<typename DOMElementType>
class MBXMLUtils::DOMElementWrapper< DOMElementType >

Helper class for extending DOMElement (use the function E(...)).

Member Function Documentation

template<typename DOMElementType >
template path MBXMLUtils::DOMElementWrapper< DOMElementType >::convertPath ( const boost::filesystem::path &  relPath) const

Convert the relative path relPath to an aboslute path by prefixing it with the path of this document. If relPath is a absolute path it is returned as it. (see also getOriginalFilename)

template<typename DOMElementType >
template int MBXMLUtils::DOMElementWrapper< DOMElementType >::getEmbedCountNumber ( ) const

Get the embed count. If a EmbedCount processing instruction child node exist this number is returned. If not 0 is returned.

template<typename DOMElementType >
template int MBXMLUtils::DOMElementWrapper< DOMElementType >::getLineNumber ( ) const

Get the line number. If a LineNr processing instruction child node exist this number is returned. If not the XML line number is returned.

template<typename DOMElementType >
template path MBXMLUtils::DOMElementWrapper< DOMElementType >::getOriginalFilename ( bool  skipThis = false,
const xercesc::DOMElement *&  found = DOMElementWrapper< DOMElementType >::dummyArg 
) const

Get the base URI. Returns the value of the first OriginalFileName PI define by a parent element or the document uri if no such element is found. If skipThis is false the OriginalFileName PI of this element in honored else this element is skipped and only parent elements are honored. If a OriginalFileName PI was found 'found' is set to this element else 'found' is NULL.

template<typename DOMElementType >
template bool MBXMLUtils::DOMElementWrapper< DOMElementType >::isDerivedFrom ( const FQN base) const

Check if the element is of type base Note DOMTypeInfo::isDerivedFrom is not implemented in xerces-c hence we define our one methode here.

template<typename DOMElementType >
void MBXMLUtils::DOMElementWrapper< DOMElementType >::setEmbedCountNumber ( int  embedCount)

Set the embed count. Is store as a processing instruction child node.

template<typename DOMElementType >
void MBXMLUtils::DOMElementWrapper< DOMElementType >::setOriginalFilename ( )

Set original filename. Calls getOriginalFilename on itself and set this value to itself. This function should/must be called when a element is removed from a tree but still used after that.


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

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML