MCPcopy Create free account
hub / github.com/Hopson97/HopsonCraft / getFileNamesFromFolder

Function getFileNamesFromFolder

Source/Util/File_Util.cpp:26–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25#ifdef __WIN32
26 std::vector<std::string> getFileNamesFromFolder(const std::string& folderName)
27 {
28 std::vector<std::string> fileNames;
29 std::string searchFor (folderName + "/*.*");
30 WIN32_FIND_DATA findData;
31 auto hFind = ::FindFirstFile(searchFor.c_str(), &findData);
32
33 if (hFind != INVALID_HANDLE_VALUE)
34 {
35 do
36 {
37 if(!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
38 {
39 fileNames.push_back(findData.cFileName);
40 }
41
42 } while (::FindNextFile(hFind, &findData));
43 }
44
45 return fileNames;
46 }
47/*
48 ///@TODO Linux/ etc of this
49 std::vector<std::string> getFolderNamesFromFolder(const std::string& folderName)

Callers 3

Music_PlayerMethod · 0.85
Main_MenuMethod · 0.85
Settings_MenuMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected