28 #ifndef WIN32_LEAN_AND_MEAN
29 #define WIN32_LEAN_AND_MEAN
33 namespace OpenSkyNet {
35 inline void GetFileNamesInDir(
const std::string& dir_, std::list<std::string>& fileNames_) {
38 WIN32_FIND_DATA findData;
39 HANDLE hFind = FindFirstFile((dir_ +
"*").c_str(), &findData);
40 if (hFind != INVALID_HANDLE_VALUE) {
41 std::string fileName(findData.cFileName);
42 if (fileName !=
"." && fileName !=
"..")
43 fileNames_.push_back(fileName);
44 while (FindNextFile(hFind, &findData)) {
45 std::string fileName(findData.cFileName);
46 if (fileName !=
"." && fileName !=
"..")
47 fileNames_.push_back(fileName);
57 namespace OpenSkyNet {
59 inline void GetFileNamesInDir(
const std::string& dir_, std::list<std::string>& fileNames_) {
63 int numNames = scandir(dir_.c_str(), &nameList, 0, alphasort);
65 for (
int i = 0; i < numNames; ++i) {
66 std::string fileName(nameList[i]->d_name);
67 if (fileName !=
"." && fileName !=
"..")
68 fileNames_.push_back(fileName);
void GetFileNamesInDir(const std::string &dir_, std::list< std::string > &fileNames_)
Definition: UDir.h:59