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

Method store_var_compat

utility/common.cpp:1273–1286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1271}
1272
1273bool gdre::store_var_compat(Ref<FileAccess> f, const Variant &p_var, int ver_major, bool p_full_objects) {
1274 int len;
1275 Error err = VariantDecoderCompat::encode_variant_compat(ver_major, p_var, nullptr, len, p_full_objects);
1276 ERR_FAIL_COND_V_MSG(err != OK, false, "Error when trying to encode Variant.");
1277
1278 Vector<uint8_t> buff;
1279 buff.resize(len);
1280
1281 uint8_t *w = buff.ptrw();
1282 err = VariantDecoderCompat::encode_variant_compat(ver_major, p_var, &w[0], len, p_full_objects);
1283 ERR_FAIL_COND_V_MSG(err != OK, false, "Error when trying to encode Variant.");
1284
1285 return f->store_32(uint32_t(len)) && f->store_buffer(buff);
1286}
1287
1288Ref<FileAccess> gdre::open_encrypted_v3(const String &p_path, int p_mode, const Vector<uint8_t> &p_key) {
1289 Ref<FileAccess> p_base = FileAccess::open(p_path, p_mode);

Callers

nothing calls this directly

Calls 2

resizeMethod · 0.45
store_bufferMethod · 0.45

Tested by

no test coverage detected