| 273 | } |
| 274 | |
| 275 | bool dir_or_file_exists(const String &path, bool include_hidden = false) { |
| 276 | String basename = get_file_name(path); |
| 277 | Ref<DirAccess> da = DirAccess::open(get_real_base_dir(path)); |
| 278 | if (da.is_null()) { |
| 279 | return false; |
| 280 | } |
| 281 | da->set_include_hidden(include_hidden); |
| 282 | if ((da->file_exists(basename) || da->dir_exists(basename))) { |
| 283 | return true; |
| 284 | } |
| 285 | return false; |
| 286 | } |
| 287 | |
| 288 | Vector<String> filter(const Vector<String> &names, |
| 289 | const String &pattern) { |
no test coverage detected