Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/ntfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/attribute.rs')
-rw-r--r--src/attribute.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/attribute.rs b/src/attribute.rs
index 42762a1..a7a1fc1 100644
--- a/src/attribute.rs
+++ b/src/attribute.rs
@@ -292,6 +292,19 @@ impl<'n, 'f> NtfsAttribute<'n, 'f> {
LittleEndian::read_u16(&self.file.record_data()[start..])
}
+ pub fn structured_value<T, S>(&self, fs: &mut T) -> Result<S>
+ where
+ T: Read + Seek,
+ S: NtfsStructuredValueFromSlice<'f>
+ + NtfsStructuredValueFromNonResidentAttributeValue<'n, 'f>,
+ {
+ if self.is_resident() {
+ self.resident_structured_value()
+ } else {
+ self.non_resident_structured_value(fs)
+ }
+ }
+
/// Returns the type of this NTFS attribute, or [`NtfsError::UnsupportedAttributeType`]
/// if it's an unknown type.
pub fn ty(&self) -> Result<NtfsAttributeType> {