use crate::PrefValue;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Domain {
User(String),
Global,
}
impl Domain {
pub fn get_cf_name(&self) -> String {
match &self {
Domain::Global => String::from(".GlobalPreferences"),
Domain::User(name) => name.clone(),
}
}
}
impl std::fmt::Display for Domain {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Domain::User(s) => write!(f, "{}", s),
Domain::Global => write!(f, "NSGlobalDomain"),
}
}
}
#[derive(Debug)]
pub struct FindMatch {
pub key: String,
pub value: PrefValue,
}