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:
authorColin Finck <colin@reactos.org>2021-06-22 09:58:50 +0300
committerColin Finck <colin@reactos.org>2021-06-23 09:09:58 +0300
commit4aa6f36eec7e8d846d6f24048acf236fe30a0d35 (patch)
treed6c4179b2e828411b81c678da573c32ce8c17a44 /src/structured_values/index_root.rs
parent1d200df64b697fcfc06c386712fbc66248eddf2e (diff)
Add `NtfsIndex` and `NtfsIndexEntries` to traverse an index in-order.
This introduces a hard dependency on alloc for a core feature. It is required as long as we don't know the B-tree depth in advance, and need to maintain a stack with elements per layer during traversal.
Diffstat (limited to 'src/structured_values/index_root.rs')
-rw-r--r--src/structured_values/index_root.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/structured_values/index_root.rs b/src/structured_values/index_root.rs
index 0a57631..0355fc0 100644
--- a/src/structured_values/index_root.rs
+++ b/src/structured_values/index_root.rs
@@ -67,6 +67,12 @@ impl<'n> NtfsIndexRoot<'n> {
pub fn is_large_index(&self) -> bool {
(self.index_node_header.flags & LARGE_INDEX_FLAG) != 0
}
+
+ pub fn position(&self) -> u64 {
+ // A structured value is always created from a valid seek position,
+ // and therefore we can safely unwrap here.
+ self.value.data_position().unwrap()
+ }
}
impl<'n> NewNtfsStructuredValue<'n> for NtfsIndexRoot<'n> {