Implement helpers: build_filepath_with_id(), prefix_of_files_for_module()
This commit is contained in:
parent
0363075f9c
commit
c81800d985
1 changed files with 11 additions and 4 deletions
|
@ -210,12 +210,19 @@ impl StorageBackend {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_filepath(&self, f: &File) -> String {
|
fn build_filepath(&self, f: &File) -> String {
|
||||||
self.build_filepath_with_id(f.id())
|
self.build_filepath_with_id(f.owner(), f.id())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_filepath_with_id(&self, id: FileID) -> String {
|
fn build_filepath_with_id(&self, owner: &Module, id: FileID) -> String {
|
||||||
debug!("Building filepath for id '{}'", id);
|
debug!("Building filepath with id");
|
||||||
self.basepath.clone() + &id[..]
|
debug!(" basepath: '{}'", self.basepath);
|
||||||
|
debug!(" storepath: '{}'", self.storepath);
|
||||||
|
debug!(" id : '{}'", id);
|
||||||
|
self.prefix_of_files_for_module(owner) + "-" + &id[..] + ".imag"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn prefix_of_files_for_module(&self, m: &Module) -> String {
|
||||||
|
self.storepath.clone() + m.name()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue