xcassets 0.1.0

Parse Xcode .xcassets catalogs into a typed Rust tree with diagnostics.
Documentation
use std::path::PathBuf;

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Diagnostic {
    pub code: DiagnosticCode,
    pub severity: Severity,
    pub path: PathBuf,
    pub message: String,
}

impl Diagnostic {
    pub(crate) fn new(
        code: DiagnosticCode,
        severity: Severity,
        path: PathBuf,
        message: impl Into<String>,
    ) -> Self {
        Self {
            code,
            severity,
            path,
            message: message.into(),
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Severity {
    Warning,
    Error,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DiagnosticCode {
    MissingContentsJson,
    InvalidContentsJson,
    InvalidContentsSchema,
    MissingReferencedFile,
    UnsupportedFolderType,
    UnreadableDirectory,
    UnreadableFile,
}