summaryrefslogtreecommitdiff
path: root/src/bin/br/formats/mod.rs
blob: b159b16e0a36755f6ece1b48172b89114cfc1a5d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
mod clang;

pub use clang::*;

use log::fatal;


#[derive(Clone, Copy, PartialEq)]
pub enum Format {
    Binary,
    Source,
    Clang,
}

impl Format {
    pub fn from_str(string: &str) -> Self {
        match string {
            "binary" => Self::Binary,
            "source" => Self::Source,
            "c" => Self::Clang,
            _ => fatal!("Unknown format '{string}', expected 'binary', 'c', or 'source'"),
        }
    }
}