MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / path_to_file

Method path_to_file

core/string/ustring.cpp:5097–5107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5095}
5096
5097String String::path_to_file(const String &p_path) const {
5098 // Don't get base dir for src, this is expected to be a dir already.
5099 String src = replace_char('\\', '/');
5100 String dst = p_path.replace_char('\\', '/').get_base_dir();
5101 String rel = src.path_to(dst);
5102 if (rel == dst) { // failed
5103 return p_path;
5104 } else {
5105 return rel + p_path.get_file();
5106 }
5107}
5108
5109String String::path_to(const String &p_path) const {
5110 String src = replace_char('\\', '/');

Callers 7

rename_dependenciesMethod · 0.80
_write_resourceMethod · 0.80
rename_dependenciesMethod · 0.80
saveMethod · 0.80
open_internalMethod · 0.80
_patch_file_selectedMethod · 0.80
set_export_pathMethod · 0.80

Calls 4

get_base_dirMethod · 0.80
replace_charMethod · 0.80
path_toMethod · 0.80
get_fileMethod · 0.45

Tested by

no test coverage detected