Mark the image files for copying.
This commit is contained in:
@@ -3,6 +3,8 @@ use std::path::PathBuf;
|
||||
|
||||
use crate::error::CustomError;
|
||||
|
||||
use super::dependency::Dependency;
|
||||
|
||||
pub(crate) type RefDependencyManager = std::sync::Arc<std::sync::Mutex<DependencyManager>>;
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -11,12 +13,15 @@ pub(crate) struct DependencyManager {
|
||||
///
|
||||
/// The last entry is the current file being processed. This can be used for handling relative-path links.
|
||||
file_stack: Vec<PathBuf>,
|
||||
|
||||
dependencies: Vec<Dependency>,
|
||||
}
|
||||
|
||||
impl DependencyManager {
|
||||
pub(crate) fn new() -> Self {
|
||||
DependencyManager {
|
||||
file_stack: Vec::new(),
|
||||
dependencies: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,4 +48,14 @@ impl DependencyManager {
|
||||
.parent()
|
||||
.ok_or("Current file was not in a directory")?)
|
||||
}
|
||||
|
||||
pub(crate) fn mark_file_for_copying<P>(&mut self, path: P) -> Result<(), CustomError>
|
||||
where
|
||||
P: Into<PathBuf>,
|
||||
{
|
||||
self.dependencies.push(Dependency::StaticFile {
|
||||
absolute_path: path.into(),
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ mod clock;
|
||||
mod code;
|
||||
mod comment;
|
||||
mod comment_block;
|
||||
mod dependency;
|
||||
mod dependency_manager;
|
||||
mod diary_sexp;
|
||||
mod document_element;
|
||||
|
||||
Reference in New Issue
Block a user