From c7fee396c6ac2c693c3ccee6ff16aac3281f3d9f Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Tue, 3 Sep 2019 14:14:29 +0200 Subject: [PATCH] src/pxar/decoder.rs: add getter functions to obtain start/end offsets for directories Signed-off-by: Christian Ebner --- src/pxar/decoder.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/pxar/decoder.rs b/src/pxar/decoder.rs index 1751b1a7..12776d66 100644 --- a/src/pxar/decoder.rs +++ b/src/pxar/decoder.rs @@ -19,6 +19,16 @@ pub struct DirectoryEntry { pub entry: PxarEntry, } +impl DirectoryEntry { + pub(crate) fn start_offset(&self) -> u64 { + self.start + } + + pub(crate) fn end_offset(&self) -> u64 { + self.end + } +} + // This one needs Read+Seek pub struct Decoder Result<(), Error>> { inner: SequentialDecoder, @@ -58,6 +68,10 @@ impl Result<(), Error>> Decoder { Ok(pos) } + pub(crate) fn root_end_offset(&self) -> u64 { + self.root_end + } + pub fn restore(&mut self, dir: &DirectoryEntry, path: &Path) -> Result<(), Error> { let start = dir.start;