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

Function encode_resource_reference

core/variant/variant_parser.cpp:2067–2075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2065/// @}
2066
2067static String encode_resource_reference(const String &path) {
2068 ResourceUID::ID uid = ResourceLoader::get_resource_uid(path);
2069 if (uid != ResourceUID::INVALID_ID) {
2070 return "Resource(\"" + ResourceUID::get_singleton()->id_to_text(uid) +
2071 "\", \"" + path.c_escape_multiline() + "\")";
2072 } else {
2073 return "Resource(\"" + path.c_escape_multiline() + "\")";
2074 }
2075}
2076
2077Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_string_func, void *p_store_string_ud, EncodeResourceFunc p_encode_res_func, void *p_encode_res_ud, int p_recursion_count, bool p_compat, bool p_full_objects) {
2078 static bool modified_security_assistance_disabled = GLOBAL_GET("application/run/disable_modified_security_assistance");

Callers 1

writeMethod · 0.85

Calls 2

id_to_textMethod · 0.80
c_escape_multilineMethod · 0.80

Tested by

no test coverage detected