diff --git a/ebml/EbmlMaster.h b/ebml/EbmlMaster.h index d2b81a2..5e3eddd 100644 --- a/ebml/EbmlMaster.h +++ b/ebml/EbmlMaster.h @@ -119,10 +119,8 @@ class EBML_DLL_API EbmlMaster : public EbmlElement { size_t ListSize() const {return ElementList.size();} - inline std::vector::const_iterator begin() {return ElementList.begin();} - inline std::vector::const_iterator end() {return ElementList.end();} - inline std::vector::const_iterator begin() const {return ElementList.begin();} - inline std::vector::const_iterator end() const {return ElementList.end();} + inline EBML_MASTER_ITERATOR begin() const {return ElementList.begin();} + inline EBML_MASTER_ITERATOR end() const {return ElementList.end();} EbmlElement * operator[](unsigned int position) {return ElementList[position];} const EbmlElement * operator[](unsigned int position) const {return ElementList[position];} @@ -142,6 +140,7 @@ class EBML_DLL_API EbmlMaster : public EbmlElement { \brief Remove an element from the list of the master */ void Remove(size_t Index); + void Remove(const EBML_MASTER_ITERATOR & Itr); /*! \brief remove all elements, even the mandatory ones diff --git a/src/EbmlMaster.cpp b/src/EbmlMaster.cpp index f81857a..8680bda 100644 --- a/src/EbmlMaster.cpp +++ b/src/EbmlMaster.cpp @@ -480,6 +480,11 @@ void EbmlMaster::Remove(size_t Index) } } +void EbmlMaster::Remove(const std::vector::const_iterator & Itr) +{ + ElementList.erase(Itr); +} + bool EbmlMaster::VerifyChecksum() const { if (!bChecksumUsed)