diff --git a/src/storage/backend.rs b/src/storage/backend.rs index 7c413b24..b2a3c499 100644 --- a/src/storage/backend.rs +++ b/src/storage/backend.rs @@ -73,6 +73,17 @@ impl StorageBackend { }).ok() } + pub fn iter_files<'a, HP>(&self, m: &'a Module, p: &Parser) + -> Option>> + where HP: FileHeaderParser + { + self.iter_ids(m).and_then(|ids| { + Some(ids.filter_map(|id| self.get_file_by_id(m, &id, p)) + .collect::>() + .into_iter()) + }) + } + /* * Write a file to disk. *