diff options
author | Omer Ben-Amram <omerbenamram@gmail.com> | 2019-05-14 15:40:56 +0300 |
---|---|---|
committer | Omer Ben-Amram <omerbenamram@gmail.com> | 2019-05-14 15:40:56 +0300 |
commit | 63d19fdb5e5887d07ca82c8164b911bc5d8fd6b5 (patch) | |
tree | 443bb970410b043ac0754ba7bf1370a9e81390a7 | |
parent | 47922bc41105a12b16b0d1072a9c1cf8364c5715 (diff) |
remove old code
-rw-r--r-- | src/entry.rs | 39 | ||||
-rw-r--r-- | src/enumerator.rs | 40 | ||||
-rw-r--r-- | src/lib.rs | 1 |
3 files changed, 2 insertions, 78 deletions
diff --git a/src/entry.rs b/src/entry.rs index a357f12..afe19d7 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -1,10 +1,9 @@ -use crate::enumerator::PathMapping; use crate::err::{self, Result}; use crate::impl_serialize_for_bitflags; use crate::attribute; -use log::{debug, trace}; -use snafu::{ensure, OptionExt, ResultExt}; +use log::trace; +use snafu::{ensure, ResultExt}; use winstructs::ntfs::mft_reference::MftReference; @@ -231,40 +230,6 @@ impl MftEntry { self.header.flags.bits() & 0x02 != 0 } - pub fn get_pathmap(&self) -> Option<PathMapping> { - for attribute in self.iter_attributes().filter_map(|a| a.ok()) { - if let attribute::MftAttributeContent::AttrX30(ref attrib) = attribute.data { - if attrib.namespace != 2 { - return Some(PathMapping { - name: attrib.name.clone(), - parent: attrib.parent, - }); - } - } - } - - None - } - - // pub fn set_full_names(&mut self, mft_handler: &mut MftHandler) { - // if self.attributes.contains_key("0x0030") { - // if let Some(attr_list) = self.attributes.get_mut("0x0030") { - // for attribute in attr_list.iter_mut() { - // // Check if resident content - // if let attribute::AttributeContent::AttrX30(ref mut attrib) = attribute.content - // { - // // Get fullpath - // let fullpath = mft_handler.get_fullpath(attrib.parent); - // // Set fullname - // let fullname = fullpath + "/" + attrib.name.as_str(); - // // Set attribute to fullname - // attrib.fullname = Some(fullname); - // } - // } - // } - // } - // } - /// Returns an iterator over the attributes of the entry. pub fn iter_attributes(&self) -> impl Iterator<Item = Result<Attribute>> + '_ { let mut cursor = Cursor::new(&self.data); diff --git a/src/enumerator.rs b/src/enumerator.rs deleted file mode 100644 index eb5e6e5..0000000 --- a/src/enumerator.rs +++ /dev/null @@ -1,40 +0,0 @@ -use std::collections::HashMap; -use winstructs::ntfs::mft_reference::MftReference; - -#[derive(Hash, Eq, PartialEq, Debug, Clone)] -pub struct PathMapping { - pub name: String, - pub parent: MftReference, -} - -#[derive(Default)] -pub struct PathEnumerator { - pub mapping: HashMap<MftReference, PathMapping>, -} - -impl PathEnumerator { - pub fn new() -> PathEnumerator { - PathEnumerator { - mapping: HashMap::new(), - } - } - - pub fn get_mapping(&self, reference: MftReference) -> Option<PathMapping> { - match self.mapping.get(&reference) { - Some(value) => Some(value.clone()), - None => None, - } - } - - pub fn print_mapping(&self) { - println!("{:?}", self.mapping); - } - - pub fn contains_mapping(&self, reference: MftReference) -> bool { - self.mapping.contains_key(&reference) - } - - pub fn set_mapping(&mut self, reference: MftReference, mapping: PathMapping) { - self.mapping.insert(reference, mapping); - } -} @@ -12,7 +12,6 @@ use std::io::{self, Read, Seek, SeekFrom}; pub mod attribute; pub mod entry; -pub mod enumerator; pub mod err; pub mod mft; |