reactive_graph_sys_file_model/component/
file.rs1use std::path::PathBuf;
2
3use crate::NAMESPACE_FILE;
4use reactive_graph_graph::component_model;
5use reactive_graph_graph::component_ty;
6use reactive_graph_graph::properties;
7
8properties!(FileProperties, (FILENAME, "filename", ""));
9
10component_ty!(COMPONENT_FILE, NAMESPACE_FILE, COMPONENT_NAME_FILE, "file");
11
12component_model!(
13 File,
14 data filename string,
15);
16
17pub trait FilePath: File {
18 fn get_path(&self) -> Option<PathBuf> {
19 self.get_filename().map(PathBuf::from)
20 }
21}