use std::collections::HashMap;
use preprocessor::Preprocessor;
use binary_object::BinaryObject;
pub struct HexPreprocessor;
impl Preprocessor for HexPreprocessor {
fn process(&self, binary_object: &BinaryObject) -> HashMap<String, String> {
let mut string = String::new();
for byte in &binary_object.data {
string.push_str(&format!("{:02X} ", byte));
}
hashmap! {
String::from("hex_data") => string
}
}
fn info(&self) -> (&'static str, &'static str) {
("hex", "creates a hexadecimal byte representation")
}
}