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

Function GetApplicationSupportPath

engine/dlib/src/dlib/sys_web.cpp:59–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 }
58
59 Result GetApplicationSupportPath(const char* application_name, char* path, uint32_t path_len)
60 {
61 const char* const DeviceMount = dmSysGetUserPersistentDataRoot();
62 if (DeviceMount && 0 < strlen(DeviceMount))
63 {
64 if (dmStrlCpy(path, DeviceMount, path_len) >= path_len)
65 return RESULT_INVAL;
66 if (dmStrlCat(path, "/", path_len) >= path_len)
67 return RESULT_INVAL;
68 }
69 else
70 {
71 path[0] = '\0';
72 }
73 if (dmStrlCat(path, ".", path_len) >= path_len)
74 return RESULT_INVAL;
75 if (dmStrlCat(path, application_name, path_len) >= path_len)
76 return RESULT_INVAL;
77 Result r = Mkdir(path, 0755);
78 if (r == RESULT_EXIST)
79 return RESULT_OK;
80 else
81 return r;
82 }
83
84 Result OpenURL(const char* url, const char* target)
85 {

Callers 5

GetApplicationSavePathFunction · 0.70
InitFunction · 0.50
TEST_FFunction · 0.50
TESTFunction · 0.50
engine.cppFile · 0.50

Calls 3

dmStrlCpyFunction · 0.85
dmStrlCatFunction · 0.85
MkdirFunction · 0.70

Tested by 2

TEST_FFunction · 0.40
TESTFunction · 0.40