From 6d713f4d0a11b3cc062b3423e8a54a35f3dd819d Mon Sep 17 00:00:00 2001 From: Vincent Huang Date: Thu, 7 Aug 2014 23:04:36 -0400 Subject: [PATCH] Added iterator for segments and sections segments and sections were already stored as std::vector. This change simply exposes the std::vector::iterator functions. --- elfio/elfio.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/elfio/elfio.hpp b/elfio/elfio.hpp index decc5e6..1af5b38 100644 --- a/elfio/elfio.hpp +++ b/elfio/elfio.hpp @@ -686,6 +686,15 @@ class elfio return new_section; } + + std::vector::iterator begin() { + return parent->sections_.begin(); + } + + std::vector::iterator end() { + return parent->sections_.end(); + } + //------------------------------------------------------------------------------ private: @@ -722,6 +731,14 @@ class elfio return parent->create_segment(); } + std::vector::iterator begin() { + return parent->segments_.begin(); + } + + std::vector::iterator end() { + return parent->segments_.end(); + } + //------------------------------------------------------------------------------ private: elfio* parent;