mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-28 08:37:12 +08:00
Include files are now grouped and sorted in following order: 1. Header file of the class the current file implements 2. Project files 3. Third party files 4. Standard library Change-Id: If31af05652184169f7fee1d7ad08f1b2ed602cf0 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
41 lines
824 B
C++
41 lines
824 B
C++
/*
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "runtime/utilities/directory.h"
|
|
|
|
#include "runtime/os_interface/windows/windows_wrapper.h"
|
|
|
|
namespace OCLRT {
|
|
|
|
std::vector<std::string> Directory::getFiles(std::string &path) {
|
|
std::vector<std::string> files;
|
|
std::string newPath;
|
|
|
|
WIN32_FIND_DATAA ffd;
|
|
HANDLE hFind = INVALID_HANDLE_VALUE;
|
|
|
|
if (path.c_str()[path.size() - 1] == '/') {
|
|
return files;
|
|
} else {
|
|
newPath = path + "/*";
|
|
}
|
|
|
|
hFind = FindFirstFileA(newPath.c_str(), &ffd);
|
|
|
|
if (INVALID_HANDLE_VALUE == hFind) {
|
|
return files;
|
|
}
|
|
|
|
do {
|
|
files.push_back(path + "/" + ffd.cFileName);
|
|
} while (FindNextFileA(hFind, &ffd) != 0);
|
|
|
|
FindClose(hFind);
|
|
return files;
|
|
}
|
|
}; // namespace OCLRT
|