MCPcopy Create free account
hub / github.com/ddnet/ddnet / ListDirectory

Method ListDirectory

src/engine/shared/storage.cpp:464–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462 }
463
464 void ListDirectory(int Type, const char *pPath, FS_LISTDIR_CALLBACK pfnCallback, void *pUser) override
465 {
466 char aBuffer[IO_MAX_PATH_LENGTH];
467 if(Type == TYPE_ALL)
468 {
469 SListDirectoryUniqueCallbackData Data;
470 Data.m_pfnDelegate = pfnCallback;
471 Data.m_pDelegateUser = pUser;
472 // list all available directories
473 for(int i = TYPE_SAVE; i < m_NumPaths; ++i)
474 fs_listdir(GetPath(i, pPath, aBuffer, sizeof(aBuffer)), ListDirectoryUniqueCallback, i, &Data);
475 }
476 else if(Type >= TYPE_SAVE && Type < m_NumPaths)
477 {
478 // list wanted directory
479 fs_listdir(GetPath(Type, pPath, aBuffer, sizeof(aBuffer)), pfnCallback, Type, pUser);
480 }
481 else
482 {
483 dbg_assert_failed("Type invalid");
484 }
485 }
486
487 const char *GetPath(int Type, const char *pDir, char *pBuffer, unsigned BufferSize) const
488 {

Callers 13

RefreshMethod · 0.80
InitAssetListFunction · 0.80
RenderSettingsCustomMethod · 0.80
OnInitMethod · 0.80
RefreshMethod · 0.80
LoadMethod · 0.80
PopupMenuSettingsMethod · 0.80
ConAddMapVotesMethod · 0.80
mainFunction · 0.80
InitMethod · 0.80
MaplistEntryCallbackMethod · 0.80

Calls 1

fs_listdirFunction · 0.85

Tested by

no test coverage detected