use crate::analyzers::Annotation;
use std::io::Write;
pub mod binja;
pub mod ghidra;
pub mod json;
pub mod table;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Format {
Table,
Json,
GhidraScript,
BinjaScript,
}
impl Format {
#[must_use]
pub fn parse(s: &str) -> Option<Self> {
match s.to_ascii_lowercase().as_str() {
"table" | "text" | "cli" => Some(Self::Table),
"json" => Some(Self::Json),
"ghidra" | "ghidra-py" | "py-ghidra" => Some(Self::GhidraScript),
"binja" | "binary-ninja" | "bn" | "py-binja" => Some(Self::BinjaScript),
_ => None,
}
}
}
pub trait OutputBackend {
fn render(&self, anns: &[Annotation], w: &mut dyn Write) -> std::io::Result<()>;
}