MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / tt_app_get_assets_path

Function tt_app_get_assets_path

TactilityC/Source/tt_app.cpp:96–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void tt_app_get_assets_path(AppHandle handle, char* buffer, size_t* size) {
97 assert(buffer != nullptr);
98 assert(size != nullptr);
99 assert(*size > 0);
100 const auto paths = HANDLE_AS_APP_CONTEXT(handle)->getPaths();
101 const auto assets_path = paths->getAssetsPath();
102 const auto expected_length = assets_path.length() + 1;
103 if (*size < expected_length) {
104 LOGGER.error("Path buffer not large enough ({} < {})", *size, expected_length);
105 *size = 0;
106 buffer[0] = 0;
107 return;
108 }
109
110 strcpy(buffer, assets_path.c_str());
111 *size = assets_path.length();
112}
113
114void tt_app_get_assets_child_path(AppHandle handle, const char* childPath, char* buffer, size_t* size) {
115 assert(buffer != nullptr);

Callers

nothing calls this directly

Calls 3

errorMethod · 0.80
getPathsMethod · 0.45
getAssetsPathMethod · 0.45

Tested by

no test coverage detected