MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / load_resource

Function load_resource

utility/diff_result.cpp:597–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

595}
596
597static Error load_resource(const String &p_path, Ref<Resource> &res) {
598 if (!FileAccess::exists(p_path)) {
599 return ERR_FILE_NOT_FOUND;
600 }
601 {
602 Ref<FileAccess> fa = FileAccess::open(p_path, FileAccess::READ);
603 if (fa.is_null() || fa->get_length() < 4) {
604 return ERR_FILE_NOT_FOUND;
605 }
606 }
607 Error error;
608 res = ResourceLoader::load(p_path, "", ResourceFormatLoader::CACHE_MODE_IGNORE_DEEP, &error);
609 if (error == OK && res.is_null()) {
610 return ERR_FILE_CORRUPT;
611 }
612 return error;
613}
614
615Ref<FileDiffResult> FileDiffResult::get_file_diff(const String &p_path, const String &p_path2, const Dictionary &p_options) {
616 Ref<Resource> res1;

Callers 1

get_file_diffMethod · 0.85

Calls 2

loadFunction · 0.85
get_lengthMethod · 0.45

Tested by

no test coverage detected