| 595 | } |
| 596 | |
| 597 | static 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 | |
| 615 | Ref<FileDiffResult> FileDiffResult::get_file_diff(const String &p_path, const String &p_path2, const Dictionary &p_options) { |
| 616 | Ref<Resource> res1; |
no test coverage detected