diff --git a/exml/AttributeList.cpp b/exml/AttributeList.cpp index 4d5fe6c..f32002a 100644 --- a/exml/AttributeList.cpp +++ b/exml/AttributeList.cpp @@ -106,4 +106,19 @@ void exml::AttributeListData::set(const std::string& _name, const std::string& _ template class exml::iterator; +exml::AttributeListData::iterator exml::AttributeListData::begin() { + return exml::AttributeListData::iterator(*this, 0); +} + +exml::AttributeListData::iterator exml::AttributeListData::end() { + return exml::AttributeListData::iterator(*this, size()); +} + +const exml::AttributeListData::iterator exml::AttributeListData::begin() const { + return exml::AttributeListData::iterator(*this, 0); +} + +const exml::AttributeListData::iterator exml::AttributeListData::end() const { + return exml::AttributeListData::iterator(*this, size()); +} diff --git a/exml/AttributeList.h b/exml/AttributeList.h index 93b9be6..90e8b63 100644 --- a/exml/AttributeList.h +++ b/exml/AttributeList.h @@ -75,12 +75,10 @@ namespace exml { void set(const std::string& _name, const std::string& _value); public: using iterator = exml::iterator; - iterator begin() { - return iterator(*this, 0); - } - iterator end() { - return iterator(*this, size()); - } + iterator begin(); + iterator end(); + const iterator begin() const; + const iterator end() const; }; /** diff --git a/exml/Element.cpp b/exml/Element.cpp index 5cee4cd..7e72e9d 100644 --- a/exml/Element.cpp +++ b/exml/Element.cpp @@ -40,6 +40,23 @@ exml::Element& exml::Element::operator= (const exml::Element& _obj) { return *this; } +exml::ElementData::iterator exml::ElementData::begin() { + return exml::ElementData::iterator(*this, 0); +} + +exml::ElementData::iterator exml::ElementData::end() { + return exml::ElementData::iterator(*this, size()); +} + +const exml::ElementData::iterator exml::ElementData::begin() const { + return exml::ElementData::iterator(*this, 0); +} + +const exml::ElementData::iterator exml::ElementData::end() const { + return exml::ElementData::iterator(*this, size()); +} + + exml::ElementData::ElementData(exml::Element* _elem) : m_data(_elem) { diff --git a/exml/Element.h b/exml/Element.h index f2b6b38..c644621 100644 --- a/exml/Element.h +++ b/exml/Element.h @@ -70,12 +70,10 @@ namespace exml { const exml::Element operator[] (const std::string& _name) const; public: using iterator = exml::iterator; - iterator begin() { - return iterator(*this, 0); - } - iterator end() { - return iterator(*this, size()); - } + iterator begin(); + iterator end(); + const iterator begin() const; + const iterator end() const; }; /** * @brief Basic element Node of an XML document <YYYYY>