use crate::*;
#[cfg(not(feature = "std"))]
use alloc::boxed::Box;
#[derive(Debug)]
pub struct FSOptions {
pub(crate) clock: Box<dyn Clock>,
pub(crate) codepage: codepage::Codepage,
pub(crate) update_file_fields: bool,
}
impl FSOptions {
#[inline]
pub fn new() -> Self {
Self::default()
}
pub fn set_codepage(&mut self, codepage: Codepage) {
self.codepage = codepage
}
pub fn with_codepage(mut self, codepage: Codepage) -> Self {
self.set_codepage(codepage);
self
}
pub fn set_update_file_fields(&mut self, update: bool) {
self.update_file_fields = update
}
pub fn with_update_file_fields(mut self, update: bool) -> Self {
self.update_file_fields = update;
self
}
}
impl Default for FSOptions {
fn default() -> Self {
Self {
clock: Box::new(DefaultClock),
codepage: codepage::Codepage::CP437,
update_file_fields: false,
}
}
}