#include <AttributeList.hpp>

Inheritance diagram for exml::internal::AttributeList:
exml::internal::Node ememory::EnableSharedFromThis< Node > ememory::EnableSharedFromThisBase exml::internal::Declaration exml::internal::Element exml::internal::DeclarationXML exml::internal::Document

Public Member Functions

size_t sizeAttribute () const
 
void appendAttribute (const ememory::SharedPtr< exml::internal::Attribute > &_attr)
 
ememory::SharedPtr< AttributegetAttr (int32_t _id)
 
ememory::SharedPtr< const AttributegetAttr (int32_t _id) const
 
std::pair< std::string, std::string > getAttrPair (int32_t _id) const
 
const std::string & getAttribute (const std::string &_name) const
 
bool existAttribute (const std::string &_name) const
 
void setAttribute (const std::string &_name, const std::string &_value)
 
bool removeAttribute (const std::string &_name)
 
bool iGenerate (std::string &_data, int32_t _indent) const override
 
void clear () override
 
- Public Member Functions inherited from exml::internal::Node
virtual ~Node ()=default
 
virtual bool iParse (const std::string &_data, int32_t &_pos, bool _caseSensitive, exml::FilePos &_filePos, exml::internal::Document &_doc)=0
 
const exml::FilePosgetPos () const
 
virtual void setValue (std::string _value)
 
virtual const std::string & getValue () const
 
virtual enum nodeType getType () const
 
virtual ememory::SharedPtr< exml::internal::DocumenttoDocument ()
 
virtual const ememory::SharedPtr< exml::internal::DocumenttoDocument () const
 
virtual ememory::SharedPtr< exml::internal::AttributetoAttribute ()
 
virtual const ememory::SharedPtr< exml::internal::AttributetoAttribute () const
 
virtual ememory::SharedPtr< exml::internal::CommenttoComment ()
 
virtual const ememory::SharedPtr< exml::internal::CommenttoComment () const
 
virtual ememory::SharedPtr< exml::internal::DeclarationtoDeclaration ()
 
virtual const ememory::SharedPtr< exml::internal::DeclarationtoDeclaration () const
 
virtual ememory::SharedPtr< exml::internal::ElementtoElement ()
 
virtual const ememory::SharedPtr< exml::internal::ElementtoElement () const
 
virtual ememory::SharedPtr< exml::internal::TexttoText ()
 
virtual const ememory::SharedPtr< exml::internal::TexttoText () const
 
bool isDocument () const
 
bool isAttribute () const
 
bool isComment () const
 
bool isDeclaration () const
 
bool isElement () const
 
bool isText () const
 
- Public Member Functions inherited from ememory::EnableSharedFromThis< Node >
ememory::SharedPtr< EMEMORY_TYPE > sharedFromThis ()
 
const ememory::SharedPtr< EMEMORY_TYPE > sharedFromThis () const
 
ememory::WeakPtr< EMEMORY_TYPE > weakFromThis ()
 
const ememory::WeakPtr< EMEMORY_TYPE > weakFromThis () const
 

Protected Member Functions

 AttributeList (const std::string &_value="")
 
- Protected Member Functions inherited from exml::internal::Node
 Node ()
 
 Node (const std::string &_value)
 
void addIndent (std::string &_data, int32_t _indent) const
 
void drawElementParsed (char32_t _val, const exml::FilePos &_filePos) const
 
bool checkAvaillable (char32_t _val, bool _firstChar) const
 
int32_t countWhiteChar (const std::string &_data, int32_t _pos, exml::FilePos &_filePos) const
 

Protected Attributes

std::vector< ememory::SharedPtr< exml::internal::Attribute > > m_listAttribute
 
- Protected Attributes inherited from exml::internal::Node
exml::FilePos m_pos
 
std::string m_value
 

Detailed Description

List of all attribute element in a node.

Constructor & Destructor Documentation

§ AttributeList()

exml::internal::AttributeList::AttributeList ( const std::string &  _value = "")
inlineprotected

Constructor.

Parameters
[in]_valueNode value;

Member Function Documentation

§ appendAttribute()

void exml::internal::AttributeList::appendAttribute ( const ememory::SharedPtr< exml::internal::Attribute > &  _attr)

add attribute on the List

Parameters
[in]_attrPointer on the attribute

§ clear()

void exml::internal::AttributeList::clear ( )
overridevirtual

clear the Node

Reimplemented from exml::internal::Node.

Reimplemented in exml::internal::Element.

§ existAttribute()

bool exml::internal::AttributeList::existAttribute ( 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

§ getAttr() [1/2]

ememory::SharedPtr<Attribute> exml::internal::AttributeList::getAttr ( int32_t  _id)

get attribute whith his ID

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

§ getAttr() [2/2]

ememory::SharedPtr<const Attribute> exml::internal::AttributeList::getAttr ( 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

§ getAttribute()

const std::string& exml::internal::AttributeList::getAttribute ( 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

§ getAttrPair()

std::pair<std::string, std::string> exml::internal::AttributeList::getAttrPair ( 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

§ iGenerate()

bool exml::internal::AttributeList::iGenerate ( std::string &  _data,
int32_t  _indent 
) const
overridevirtual

generate a string with the tree of the xml

Parameters
[in,out]_datastring where to add the elements
[in]_indentcurrent indentation of the file
Returns
false if an error occured.

Reimplemented from exml::internal::Node.

Reimplemented in exml::internal::Element, exml::internal::Document, and exml::internal::Declaration.

§ removeAttribute()

bool exml::internal::AttributeList::removeAttribute ( 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.

§ setAttribute()

void exml::internal::AttributeList::setAttribute ( 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

§ sizeAttribute()

size_t exml::internal::AttributeList::sizeAttribute ( ) const
inline

get the number of attribute in the Node

Returns
Nulber of attribute >=0

Member Data Documentation

§ m_listAttribute

std::vector<ememory::SharedPtr<exml::internal::Attribute> > exml::internal::AttributeList::m_listAttribute
protected

list of all attribute


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