MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / path_to_file

Method path_to_file

modules/gui/gui/src/backend/text_server/ustring.cpp:5194–5208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5192}
5193
5194String String::path_to_file(const String& p_path) const
5195{
5196 // Don't get base dir for src, this is expected to be a dir already.
5197 String src = this->replace("\\", "/");
5198 String dst = p_path.replace("\\", "/").get_base_dir();
5199 String rel = src.path_to(dst);
5200 if (rel == dst)
5201 { // failed
5202 return p_path;
5203 }
5204 else
5205 {
5206 return rel + p_path.get_file();
5207 }
5208}
5209
5210String String::path_to(const String& p_path) const
5211{

Callers

nothing calls this directly

Calls 4

replaceMethod · 0.95
get_base_dirMethod · 0.80
path_toMethod · 0.80
get_fileMethod · 0.80

Tested by

no test coverage detected