MCPcopy Create free account
hub / github.com/PerroEngine/Perro / resolve_path_string

Function resolve_path_string

perro_source/api_modules/perro_modules/src/file.rs:96–113  ·  view source on GitHub ↗
(path: P)

Source from the content-addressed store, hash-verified

94 pick_file_impl(title, filters)
95}
96
97pub fn resolve_path_string<P: ResPathSource>(path: P) -> String {
98 let path = path.as_res_path_str();
99 if let Err(err) = validate_virtual_asset_path(path) {
100 return format!("invalid://{err}");
101 }
102 match perro_io::resolve_path(path) {
103 perro_io::ResolvedPath::Excluded(path) => format!("excluded+demo://{path}"),
104 perro_io::ResolvedPath::Disk(pb) => pb.to_string_lossy().to_string(),
105 perro_io::ResolvedPath::WebUserStorage(key) => format!("webstorage://{key}"),
106 perro_io::ResolvedPath::PerroAssets(vpath) => format!("perroassets://{vpath}"),
107 perro_io::ResolvedPath::StaticBinary(path) => format!("staticbinary://{path}"),
108 perro_io::ResolvedPath::DlcStaticBinary { dlc, path } => {
109 format!("staticbinary+dlc://{dlc}/{path}")
110 }
111 perro_io::ResolvedPath::DlcPerroAssets { dlc, virtual_path } => {
112 format!("perroassets+dlc://{dlc}/{virtual_path}")
113 }
114 }
115}
116

Callers

nothing calls this directly

Calls 3

as_res_path_strMethod · 0.80
resolve_pathFunction · 0.50

Tested by

no test coverage detected