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

Method get_file_size

utility/file_access_gdre.cpp:386–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386int64_t GDREPackedData::get_file_size(const String &p_path) {
387 String simplified_path = p_path.simplify_path().trim_prefix("res://");
388 PathMD5 pmd5(simplified_path.md5_buffer());
389 HashMap<PathMD5, PackedData::PackedFile, PathMD5>::Iterator E = files.find(pmd5);
390 if (!E) {
391 return -1; //not found
392 }
393 if (E->value.offset == 0) {
394 return -1; //was erased
395 }
396 return E->value.size;
397}
398
399Ref<FileAccess> GDREPackedData::try_open_path(const String &p_path) {
400 String simplified_path = p_path.simplify_path().trim_prefix("res://");

Callers 1

_get_sizeMethod · 0.80

Calls 1

findMethod · 0.45

Tested by

no test coverage detected