exml::ElementData Class Reference

#include <Element.hpp>

Public Types

using iterator = exml::iterator< exml::ElementData, exml::Node >
 

Public Member Functions

 ElementData (exml::Element *_list)
 
size_t size () const
 
void add (const exml::Node &_node)
 
void remove (const std::string &_nodeName)
 
enum nodeType getType (int32_t _id) const
 
exml::Node operator[] (int32_t _id)
 
const exml::Node operator[] (int32_t _id) const
 
exml::Element operator[] (const std::string &_name)
 
const exml::Element operator[] (const std::string &_name) const
 
iterator begin ()
 
iterator end ()
 
const iterator begin () const
 
const iterator end () const
 

Detailed Description

Basic element Node of an XML document <YYYYY>.

Todo:

Remove node with a specisic ID/Iterator (erase)

Remove an Node with his exml::Element link

Member Typedef Documentation

§ iterator

Specify iterator of the element methode.

Constructor & Destructor Documentation

§ ElementData()

exml::ElementData::ElementData ( exml::Element _list)

constructor on the ElementData class

Parameters
[in]_listGet pointer on the exml::Element class (must not be nullptr)

Member Function Documentation

§ add()

void exml::ElementData::add ( const exml::Node _node)

add a node at the element (not exml::Attribute (move in the attribute automaticly).

Parameters
[in]_nodeNode to add.

§ begin() [1/2]

iterator exml::ElementData::begin ( )

Get iterator of the first sub nodes.

Returns
iterator on the begin position of the nodes

§ begin() [2/2]

const iterator exml::ElementData::begin ( ) const

Get const iterator of the first sub nodes.

Returns
const iterator on the begin position of the nodes

§ end() [1/2]

iterator exml::ElementData::end ( )

Get iterator of the next of the last sub nodes.

Returns
iterator on the next of the last position of the nodes

§ end() [2/2]

const iterator exml::ElementData::end ( ) const

Get const iterator of the next of the last sub nodes.

Returns
const iterator on the next of the last position of the nodes

§ getType()

enum nodeType exml::ElementData::getType ( int32_t  _id) const

get the type of the element id.

Parameters
[in]_idId of the element.
Returns
the Current type of the element or exml::typeUnknow.

§ operator[]() [1/4]

exml::Node exml::ElementData::operator[] ( int32_t  _id)

get the Node pointer of the element id.

Parameters
[in]_idId of the element.
Returns
Pointer on node.

§ operator[]() [2/4]

const exml::Node exml::ElementData::operator[] ( int32_t  _id) const

get the Node pointer of the element id.

Parameters
[in]_idId of the element.
Returns
Pointer on node.

§ operator[]() [3/4]

exml::Element exml::ElementData::operator[] ( const std::string &  _name)

get an element with his name (work only with exml::Element)

Parameters
[in]_nameName of the element that is requested
Returns
Pointer on the element or NULL.

§ operator[]() [4/4]

const exml::Element exml::ElementData::operator[] ( const std::string &  _name) const

get an element with his name (work only with exml::Element)

Parameters
[in]_nameName of the element that is requested
Returns
Pointer on the element or NULL.

§ remove()

void exml::ElementData::remove ( const std::string &  _nodeName)

Remove a node with his name.

Parameters
[in]_nodeNameName of the node.

§ size()

size_t exml::ElementData::size ( ) const

get the number of sub element in the node (can be exml::Comment ; exml::Element ; exml::Text :exml::Declaration).

Returns
a number >=0.

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