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

Function ResolveFilePath

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

Source from the content-addressed store, hash-verified

57 }
58
59 static char* ResolveFilePath(const dmURI::Parts* uri, const char* path, char* buffer, uint32_t buffer_len)
60 {
61 char mountpath[DMPATH_MAX_PATH];
62 dmSnPrintf(mountpath, sizeof(mountpath), "%s%s%s", uri->m_Location, uri->m_Path, path);
63
64 if (dmSys::RESULT_OK != dmSys::ResolveMountFileName(buffer, buffer_len, mountpath))
65 {
66 // on some platforms, performing operations on non existing files will halt the engine
67 // so we're better off returning here immediately
68 return 0;
69 }
70 return buffer;
71 }
72
73 static dmResourceProvider::Result SysResultToProviderResult(dmSys::Result r)
74 {

Callers 3

GetFileSizeFunction · 0.85
ReadFileFunction · 0.85
ReadFilePartialFunction · 0.85

Calls 2

dmSnPrintfFunction · 0.85
ResolveMountFileNameFunction · 0.85

Tested by

no test coverage detected