use std::ops::Deref;
use crate::config::{BoxFlags, GeneratorFlags, TypedefMode};
use crate::models::{code::IdentPath, meta::MetaTypes};
#[derive(Debug)]
pub struct MetaData<'types> {
pub types: &'types MetaTypes,
pub flags: GeneratorFlags,
pub postfixes: [String; 10],
pub box_flags: BoxFlags,
pub typedef_mode: TypedefMode,
pub text_type: IdentPath,
pub mixed_type: IdentPath,
pub nillable_type: IdentPath,
pub any_type: IdentPath,
pub any_attributes_type: IdentPath,
}
impl MetaData<'_> {
#[inline]
#[must_use]
pub fn check_generator_flags(&self, flags: GeneratorFlags) -> bool {
self.flags.intersects(flags)
}
}
impl Deref for MetaData<'_> {
type Target = MetaTypes;
fn deref(&self) -> &Self::Target {
self.types
}
}