exml::AttributeListData Class Reference

#include <AttributeList.hpp>

Public Types

using iterator = exml::iterator< exml::AttributeListData, exml::Attribute >
 

Public Member Functions

 AttributeListData (exml::AttributeList *_list)
 
size_t size () const
 
void add (exml::Attribute _attr)
 
bool remove (const std::string &_name)
 
exml::Attribute operator[] (int32_t _id)
 
const exml::Attribute operator[] (int32_t _id) const
 
std::pair< std::string, std::string > getPair (int32_t _id) const
 
const std::string & operator[] (const std::string &_name) const
 
bool exist (const std::string &_name) const
 
void set (const std::string &_name, const std::string &_value)
 
iterator begin ()
 
iterator end ()
 
const iterator begin () const
 
const iterator end () const
 

Detailed Description

Abstract interface on all attributes elements.

Member Typedef Documentation

§ iterator

Constructor & Destructor Documentation

§ AttributeListData()

exml::AttributeListData::AttributeListData ( exml::AttributeList _list)

Constructor on the AttributeListData class.

Parameters
[in]_listPoint on the parrent class (must not be nullptr)

Member Function Documentation

§ add()

void exml::AttributeListData::add ( exml::Attribute  _attr)

add attribute on the List

Parameters
[in]_attrPointer on the attribute

§ begin() [1/2]

iterator exml::AttributeListData::begin ( )

Get iterator of the first sub nodes.

Returns
iterator on the begin position of the nodes

§ begin() [2/2]

const iterator exml::AttributeListData::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::AttributeListData::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::AttributeListData::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

§ exist()

bool exml::AttributeListData::exist ( const std::string &  _name) const

check if an attribute exist or not with his name.

Parameters
[in]_nameAttribute Name.
Returns
true if the attribute exist or False

§ getPair()

std::pair<std::string, std::string> exml::AttributeListData::getPair ( int32_t  _id) const

get attribute whith his ID

Parameters
[in]_idIdentifier of the attribute 0<= _id < sizeAttribute()
Returns
Name and value of the attribute

§ operator[]() [1/3]

exml::Attribute exml::AttributeListData::operator[] ( int32_t  _id)

get attribute whith his ID

Parameters
[in]_idIdentifier of the attribute 0<= _id < sizeAttribute()
Returns
Pointer on the attribute or NULL

§ operator[]() [2/3]

const exml::Attribute exml::AttributeListData::operator[] ( int32_t  _id) const

get attribute whith his ID

Parameters
[in]_idIdentifier of the attribute 0<= _id < sizeAttribute()
Returns
Pointer on the attribute or NULL

§ operator[]() [3/3]

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

get the attribute value with searching in the List with his name

Parameters
[in]_nameAttribute Name.
Returns
Value of the attribute or no data in the string

§ remove()

bool exml::AttributeListData::remove ( const std::string &  _name)

Remove an attribute form the list.

Parameters
[in]_nameName of the attribute
Returns
true The attribute has been removed
false An error occured.

§ set()

void exml::AttributeListData::set ( const std::string &  _name,
const std::string &  _value 
)

Set A new attribute or replace data of the previous one.

Parameters
[in]_nameName of the attribute
[in]_valueValue of the attribute

§ size()

size_t exml::AttributeListData::size ( ) const

get the number of attribute in the Node

Returns
Number of attribute >=0

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