use crate::Error;
pub const BUILTIN_RULE_SETS: &[&str] = &[
#[cfg(feature = "cen-ubl")]
"cen-ubl",
#[cfg(feature = "cen-cii")]
"cen-cii",
];
pub(crate) type Files = &'static [(&'static str, &'static [u8])];
pub(crate) fn get(name: &str) -> Result<(&'static str, Files), Error> {
match name {
#[cfg(feature = "cen-ubl")]
"cen-ubl" => Ok((
include_str!("../bundles/cen-ubl/bundle.toml"),
&[(
"ubl/xslt/EN16931-UBL-validation.xslt",
include_bytes!("../bundles/cen-ubl/ubl/xslt/EN16931-UBL-validation.xslt"),
)],
)),
#[cfg(feature = "cen-cii")]
"cen-cii" => Ok((
include_str!("../bundles/cen-cii/bundle.toml"),
&[(
"cii/xslt/EN16931-CII-validation.xslt",
include_bytes!("../bundles/cen-cii/cii/xslt/EN16931-CII-validation.xslt"),
)],
)),
_ => Err(Error::bundle(format!(
"no built-in rule set named {name:?} (built in: {})",
if BUILTIN_RULE_SETS.is_empty() {
"none".to_owned()
} else {
BUILTIN_RULE_SETS.join(", ")
}
))),
}
}