2024-07-01 18:18:34 +00:00
|
|
|
#[derive(Clone,Copy,Debug)]
|
|
|
|
pub enum Style{
|
|
|
|
Rox,
|
|
|
|
Rojo,
|
|
|
|
RoxRojo,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Default)]
|
|
|
|
pub(crate) struct PropertiesOverride{
|
|
|
|
pub name:Option<String>,
|
|
|
|
pub class:Option<String>,
|
|
|
|
}
|
|
|
|
impl PropertiesOverride{
|
|
|
|
pub fn is_some(&self)->bool{
|
|
|
|
self.name.is_some()
|
|
|
|
||self.class.is_some()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl std::fmt::Display for PropertiesOverride{
|
|
|
|
fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{
|
|
|
|
if let Some(name)=self.name.as_deref(){
|
2024-07-04 20:32:00 +00:00
|
|
|
writeln!(f,"-- Properties.Name = \"{}\"",name)?;
|
2024-07-01 18:18:34 +00:00
|
|
|
}
|
|
|
|
if let Some(class)=self.class.as_deref(){
|
2024-07-04 20:32:00 +00:00
|
|
|
writeln!(f,"-- Properties.ClassName = \"{}\"",class)?;
|
2024-07-01 18:18:34 +00:00
|
|
|
}
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub(crate) fn sanitize<'a>(s:&'a str)->std::borrow::Cow<'a,str>{
|
2024-07-04 20:32:00 +00:00
|
|
|
lazy_regex::regex!(r"[^A-Za-z0-9.-]").replace_all(s,"_")
|
2024-07-01 18:18:34 +00:00
|
|
|
}
|