ome-common  5.5.0
Public Member Functions | List of all members
ome::common::xml::dom::Element Class Reference

DOM Element wrapper. More...

#include <ome/common/xml/dom/Element.h>

+ Inheritance diagram for ome::common::xml::dom::Element:
+ Collaboration diagram for ome::common::xml::dom::Element:

Public Member Functions

 Element ()
 Construct a NULL Element.
 
 Element (const Element &element)
 Copy construct an Element. More...
 
 Element (const Wrapper< xercesc::DOMElement, Node >::base_type &base)
 Copy construct an Element. More...
 
 Element (xercesc::DOMElement *element, bool managed)
 Construct an Element from a xercesc::DOMElement *. More...
 
 Element (Wrapper< xercesc::DOMElement, Node >::base_element_type *base, bool managed)
 Construct an Element from a xercesc::DOMNode *. More...
 
 ~Element ()
 Destructor.
 
String getTagName () const
 Get Element tag name. More...
 
NodeList getElementsByTagName (const std::string &name)
 Get child elements with a given tag name. More...
 
bool hasAttribute (const std::string &attr) const
 Check if the Element has the specified attribute. More...
 
String getAttribute (const std::string &attr) const
 Get the specified attribute value. More...
 
void setAttribute (const std::string &attr, const std::string &val)
 Set the specified attribute value. More...
 
String getTextContent () const
 Get Element text content. More...
 
void setTextContent (const std::string &val)
 Set Element text content. More...
 
- Public Member Functions inherited from ome::common::xml::dom::Wrapper< xercesc::DOMElement, Node >
 Wrapper ()
 Constructor.
 
 Wrapper (const base_type &base)
 Copy construct a Wrapper. More...
 
 Wrapper (typename parent_type::base_element_type *base, Deleter del)
 Construct a Wrapper from a base_element_type * (managed). More...
 
 Wrapper (typename parent_type::base_element_type *base)
 Construct a Wrapper from a base_element_type * (unmanaged). More...
 
 ~Wrapper ()
 Destructor.
 
element_typeget ()
 Get wrapped element_type *. More...
 
const element_typeget () const
 Get wrapped element_type *. More...
 
Wrapperoperator= (const Wrapper &wrapped)
 Assign a Wrapper. More...
 
element_typeoperator* ()
 Dereference to element_type. More...
 
const element_typeoperator* () const
 Dereference to const element_type. More...
 
element_typeoperator-> ()
 Dereference to element_type. More...
 
const element_typeoperator-> () const
 Dereference to const element_type. More...
 
- Public Member Functions inherited from ome::common::xml::dom::Node
 Node ()
 Construct a NULL Node.
 
 Node (const Node &node)
 Copy construct a Node. More...
 
 Node (xercesc::DOMNode *node, bool managed)
 Construct a Node from a xercesc::DOMNode *. More...
 
 ~Node ()
 Destructor.
 
Node appendChild (Node &node)
 Append a child Node. More...
 
node_type getNodeType ()
 Get the object type of this node. More...
 
NodeList getChildNodes ()
 Get child nodes. More...
 
NamedNodeMap getAttributes ()
 Get node attributes. More...
 
std::string getNodeValue ()
 Get node value. More...
 
std::string getTextContent ()
 Get node text content. More...
 
- Public Member Functions inherited from ome::common::xml::dom::Wrapper< xercesc::DOMNode, Base< xercesc::DOMNode > >
 Wrapper ()
 Constructor.
 
 Wrapper (const base_type &base)
 Copy construct a Wrapper. More...
 
 Wrapper (typename parent_type::base_element_type *base, Deleter del)
 Construct a Wrapper from a base_element_type * (managed). More...
 
 Wrapper (typename parent_type::base_element_type *base)
 Construct a Wrapper from a base_element_type * (unmanaged). More...
 
 ~Wrapper ()
 Destructor.
 
element_typeget ()
 Get wrapped element_type *. More...
 
const element_typeget () const
 Get wrapped element_type *. More...
 
Wrapperoperator= (const Wrapper &wrapped)
 Assign a Wrapper. More...
 
element_typeoperator* ()
 Dereference to element_type. More...
 
const element_typeoperator* () const
 Dereference to const element_type. More...
 
element_typeoperator-> ()
 Dereference to element_type. More...
 
const element_typeoperator-> () const
 Dereference to const element_type. More...
 
- Public Member Functions inherited from ome::common::xml::dom::Base< xercesc::DOMNode >
 Base ()
 Constructor.
 
 Base (base_element_type *wrapped, Deleter del)
 Construct with initial wrapped value (managed). More...
 
 Base (base_element_type *wrapped)
 Construct with initial wrapped value (unmanaged). More...
 
virtual ~Base ()
 Destructor.
 
base_element_typeget ()
 Get wrapped base_element_type *. More...
 
const base_element_typeget () const
 Get wrapped base_element_type *. More...
 
 operator bool () const
 Check if the wrapped type is not null. More...
 
bool operator== (std::nullptr_t) const
 Check if the wrapped type is null. More...
 
bool operator!= (std::nullptr_t) const
 Check if the wrapped type is not null. More...
 
void reset ()
 Free the managed resource. More...
 

Additional Inherited Members

- Public Types inherited from ome::common::xml::dom::Wrapper< xercesc::DOMElement, Node >
typedef Node parent_type
 Parent type.
 
typedef parent_type::base_type base_type
 Base type.
 
typedef parent_type::base_element_type base_element_type
 Base element type.
 
typedef xercesc::DOMElement element_type
 Wrapped Xerces element type.
 
- Public Types inherited from ome::common::xml::dom::Node
typedef xercesc::DOMNode::NodeType node_type
 The derived object type of a node.
 
- Public Types inherited from ome::common::xml::dom::Wrapper< xercesc::DOMNode, Base< xercesc::DOMNode > >
typedef Base< xercesc::DOMNode > parent_type
 Parent type.
 
typedef parent_type::base_type base_type
 Base type.
 
typedef parent_type::base_element_type base_element_type
 Base element type.
 
typedef xercesc::DOMNode element_type
 Wrapped Xerces element type.
 
- Public Types inherited from ome::common::xml::dom::Base< xercesc::DOMNode >
typedef Base base_type
 Base type.
 
typedef xercesc::DOMNode base_element_type
 Base element type (root type of the wrapped type).
 
- Protected Member Functions inherited from ome::common::xml::dom::Wrapper< xercesc::DOMElement, Node >
virtual void assign (const base_type &wrapped)
 Assign a new wrapped value. More...
 
virtual void assign (std::shared_ptr< base_element_type > &wrapped)
 Assign a new wrapped value. More...
 
- Protected Member Functions inherited from ome::common::xml::dom::Base< xercesc::DOMNode >
virtual void null_check () const
 Check if the wrapped type is null. More...
 
D * assign_check (base_element_type *newbase)
 Check that a new wrapped value is of the correct derived type. More...
 

Detailed Description

DOM Element wrapper.

The wrapper behaves as though is the wrapped DOMElement; it can be dereferenced using the "*" or "->" operators to obtain a reference or pointer to the wrapped object. It can also be cast to a pointer to the wrapped object, so can substitute for it directly.

Constructor & Destructor Documentation

◆ Element() [1/4]

ome::common::xml::dom::Element::Element ( const Element element)
inline

Copy construct an Element.

Parameters
elementthe Element to copy.

◆ Element() [2/4]

ome::common::xml::dom::Element::Element ( const Wrapper< xercesc::DOMElement, Node >::base_type base)
inline

Copy construct an Element.

Parameters
basethe base type to copy (must be an Element).

◆ Element() [3/4]

ome::common::xml::dom::Element::Element ( xercesc::DOMElement *  element,
bool  managed 
)
inline

Construct an Element from a xercesc::DOMElement *.

Parameters
elementthe Element to wrap.
managedis the value to be managed?

◆ Element() [4/4]

ome::common::xml::dom::Element::Element ( Wrapper< xercesc::DOMElement, Node >::base_element_type base,
bool  managed 
)
inline

Construct an Element from a xercesc::DOMNode *.

Parameters
basethe DOMNode to wrap.
managedis the value to be managed?

Member Function Documentation

◆ getAttribute()

String ome::common::xml::dom::Element::getAttribute ( const std::string &  attr) const
inline

Get the specified attribute value.

Parameters
attrthe attribute to get.
Returns
the attribute value.

◆ getElementsByTagName()

NodeList ome::common::xml::dom::Element::getElementsByTagName ( const std::string &  name)
inline

Get child elements with a given tag name.

Parameters
namethe element name to use.
Returns
the child nodes (if any).

◆ getTagName()

String ome::common::xml::dom::Element::getTagName ( ) const
inline

Get Element tag name.

Returns
the tag name.

◆ getTextContent()

String ome::common::xml::dom::Element::getTextContent ( ) const
inline

Get Element text content.

Returns
the text content.

◆ hasAttribute()

bool ome::common::xml::dom::Element::hasAttribute ( const std::string &  attr) const
inline

Check if the Element has the specified attribute.

Parameters
attrthe attribute to check.
Returns
true if the Element has the attribute, otherwise false.

◆ setAttribute()

void ome::common::xml::dom::Element::setAttribute ( const std::string &  attr,
const std::string &  val 
)
inline

Set the specified attribute value.

Parameters
attrthe attribute to set.
valthe value to set.

◆ setTextContent()

void ome::common::xml::dom::Element::setTextContent ( const std::string &  val)
inline

Set Element text content.

Parameters
valthe text content to set.

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