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

Method load_source_code

modules/mono/csharp_script.cpp:2764–2778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2762}
2763
2764Error CSharpScript::load_source_code(const String &p_path) {
2765 Error ferr = read_all_file_utf8(p_path, source);
2766
2767 ERR_FAIL_COND_V_MSG(ferr != OK, ferr,
2768 ferr == ERR_INVALID_DATA
2769 ? "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded."
2770 " Please ensure that scripts are saved in valid UTF-8 unicode."
2771 : "Failed to read file: '" + p_path + "'.");
2772
2773#ifdef TOOLS_ENABLED
2774 source_changed_cache = true;
2775#endif
2776
2777 return OK;
2778}
2779
2780void CSharpScript::_clear() {
2781 type_info = TypeInfo();

Callers 1

loadMethod · 0.45

Calls 1

read_all_file_utf8Function · 0.85

Tested by

no test coverage detected