Added iterator for segments and sections

segments and sections were already stored as std::vector<T>.
This change simply exposes the std::vector<T>::iterator functions.
This commit is contained in:
Vincent Huang 2014-08-07 23:04:36 -04:00
parent b227bf1482
commit 6d713f4d0a

View File

@ -686,6 +686,15 @@ class elfio
return new_section;
}
std::vector<section*>::iterator begin() {
return parent->sections_.begin();
}
std::vector<section*>::iterator end() {
return parent->sections_.end();
}
//------------------------------------------------------------------------------
private:
@ -722,6 +731,14 @@ class elfio
return parent->create_segment();
}
std::vector<segment*>::iterator begin() {
return parent->segments_.begin();
}
std::vector<segment*>::iterator end() {
return parent->segments_.end();
}
//------------------------------------------------------------------------------
private:
elfio* parent;