use interoptopus::writer::IndentWriter;
use interoptopus::Interop;
use interoptopus::{Error, Library};
mod config;
mod converter;
mod writer;
pub use crate::config::Config;
pub use converter::{CTypeConverter, Converter};
pub use writer::CWriter;
pub struct Generator {
config: Config,
library: Library,
converter: Converter,
}
impl Generator {
pub fn new(config: Config, library: Library) -> Self {
Self {
config: config.clone(),
library,
converter: Converter { config },
}
}
}
impl Interop for Generator {
fn write_to(&self, w: &mut IndentWriter) -> Result<(), Error> {
self.write_all(w)
}
}
impl CWriter for Generator {
fn config(&self) -> &Config {
&self.config
}
fn library(&self) -> &Library {
&self.library
}
fn converter(&self) -> &Converter {
&self.converter
}
}