]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/pxar/decoder.rs: add getter functions to obtain start/end offsets for directories
authorChristian Ebner <c.ebner@proxmox.com>
Tue, 3 Sep 2019 12:14:29 +0000 (14:14 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 4 Sep 2019 04:10:56 +0000 (06:10 +0200)
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
src/pxar/decoder.rs

index 1751b1a735a5d20bd8b5ae543c154d88044b65c2..12776d667a60c12291ac4e5eff86e557df209903 100644 (file)
@@ -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<R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> {
     inner: SequentialDecoder<R, F>,
@@ -58,6 +68,10 @@ impl<R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> Decoder<R, F> {
         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;