MCPcopy Create free account
hub / github.com/defold/defold / ReadFilePartial

Function ReadFilePartial

engine/resource/src/providers/provider_file.cpp:115–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113 }
114
115 static dmResourceProvider::Result ReadFilePartial(dmResourceProvider::HArchiveInternal _archive, dmhash_t path_hash, const char* path, uint32_t offset, uint32_t size, uint8_t* buffer, uint32_t* nread)
116 {
117 FileProviderContext* archive = (FileProviderContext*)_archive;
118 (void)path_hash;
119
120 char path_buffer[DMPATH_MAX_PATH];
121 const char* resolved_path = ResolveFilePath(&archive->m_BaseUri, path, path_buffer, sizeof(path_buffer));
122 if (!resolved_path) {
123 return dmResourceProvider::RESULT_NOT_FOUND;
124 }
125
126 dmSys::Result r = dmSys::LoadResourcePartial(resolved_path, offset, size, buffer, nread);
127 return SysResultToProviderResult(r);
128 }
129
130 static void SetupArchiveLoader(dmResourceProvider::ArchiveLoader* loader)
131 {

Callers

nothing calls this directly

Calls 3

ResolveFilePathFunction · 0.85
LoadResourcePartialFunction · 0.50

Tested by

no test coverage detected