MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / ExistsApplicationContent

Function ExistsApplicationContent

Goldleaf/source/cnt/cnt_Content.cpp:329–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327 }
328
329 std::optional<std::reference_wrapper<Application>> ExistsApplicationContent(const u64 program_id, const NcmContentMetaType content_type) {
330 ScopedLock lk(g_ApplicationsLock);
331
332 const auto app_id = GetBaseApplicationId(program_id, content_type);
333
334 const auto app_it = std::find_if(g_Applications.begin(), g_Applications.end(), [&](const Application &app) -> bool {
335 if(app.record.id == app_id) {
336 const auto cnt_it = std::find_if(app.meta_status_list.begin(), app.meta_status_list.end(), [&](const NsApplicationContentMetaStatus &cnt_status) -> bool {
337 return (cnt_status.application_id == program_id) && (cnt_status.storageID != NcmStorageId_GameCard);
338 });
339
340 if(cnt_it != app.meta_status_list.end()) {
341 return true;
342 }
343 else {
344 return false;
345 }
346 }
347 else {
348 return false;
349 }
350 });
351
352 if(app_it != g_Applications.end()) {
353 return std::optional(std::reference_wrapper(*app_it));
354 }
355 else {
356 return {};
357 }
358 }
359
360 std::optional<std::reference_wrapper<Application>> ExistsApplicationAnyContents(const u64 program_id) {
361 auto app = ExistsApplicationContent(program_id, NcmContentMetaType_Application);

Callers 4

PrepareInstallationMethod · 0.85
StartInstallMethod · 0.85

Calls 1

GetBaseApplicationIdFunction · 0.85

Tested by

no test coverage detected