diff options
Diffstat (limited to 'src/attribute_value.rs')
-rw-r--r-- | src/attribute_value.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/attribute_value.rs b/src/attribute_value.rs index b49c684..f7cd840 100644 --- a/src/attribute_value.rs +++ b/src/attribute_value.rs @@ -25,7 +25,14 @@ impl<'n> NtfsAttributeValue<'n> { NtfsAttributeValueAttached::new(fs, self) } - pub(crate) fn position(&self) -> u64 { + pub fn len(&self) -> u64 { + match self { + Self::Resident(inner) => inner.len(), + Self::NonResident(inner) => inner.len(), + } + } + + pub fn position(&self) -> u64 { match self { Self::Resident(inner) => inner.position(), Self::NonResident(inner) => inner.position(), @@ -79,6 +86,10 @@ where self.value } + pub fn len(&self) -> u64 { + self.value.len() + } + pub fn position(&self) -> u64 { self.value.position() } @@ -346,6 +357,10 @@ impl<'n> NtfsAttributeNonResidentValue<'n> { NtfsDataRuns::new(self.ntfs, self.data_runs_range.clone()) } + pub fn len(&self) -> u64 { + self.data_size + } + pub fn position(&self) -> u64 { self.data_runs_range.start } |