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

Method get_current_dir

platform/android/dir_access_jandroid.cpp:148–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148String DirAccessJAndroid::get_current_dir(bool p_include_drive) const {
149 String base = _get_root_path();
150 String bd = current_dir;
151 if (!base.is_empty()) {
152 bd = current_dir.replace_first(base, "");
153 }
154
155 String root_string = _get_root_string();
156 if (bd.begins_with(root_string)) {
157 return bd;
158 } else if (bd.begins_with("/")) {
159 return root_string + bd.substr(1);
160 } else {
161 return root_string + bd;
162 }
163}
164
165Error DirAccessJAndroid::change_dir(String p_dir) {
166 String new_dir = get_absolute_path(p_dir);

Callers 1

export_projectMethod · 0.45

Calls 4

replace_firstMethod · 0.80
begins_withMethod · 0.80
substrMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected