Skip to content

Commit

Permalink
read/pe: add DataDirectories::enumerate (gimli-rs#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
daladim committed Sep 28, 2021
1 parent f4ac757 commit 4672148
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/read/pe/data_directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ impl<'data> DataDirectories<'data> {
self.entries.iter()
}

/// Iterator which gives the directories as well as their index (one of the IMAGE_DIRECTORY_ENTRY_* constants).
pub fn enumerate(&self) -> core::iter::Enumerate<slice::Iter<'data, pe::ImageDataDirectory>> {
self.entries.iter().enumerate()
}

/// Returns the data directory at the given index.
///
/// Index should be one of the `IMAGE_DIRECTORY_ENTRY_*` constants.
Expand Down

0 comments on commit 4672148

Please sign in to comment.