| 94 | } |
| 95 | |
| 96 | void 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 | |
| 114 | void tt_app_get_assets_child_path(AppHandle handle, const char* childPath, char* buffer, size_t* size) { |
| 115 | assert(buffer != nullptr); |
nothing calls this directly
no test coverage detected