Update utils.cpp
This commit is contained in:
parent
adc4398cc5
commit
fcc6b97f88
@ -72,7 +72,7 @@ bool ends_with(std::string const &value, std::string const &ending)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// source: https://stackoverflow.com/a/37416569/192001
|
// Based on: https://stackoverflow.com/a/37416569/192001
|
||||||
std::size_t count_files(const std::string &folder)
|
std::size_t count_files(const std::string &folder)
|
||||||
{
|
{
|
||||||
size_t counter = 0;
|
size_t counter = 0;
|
||||||
@ -80,7 +80,7 @@ std::size_t count_files(const std::string &folder)
|
|||||||
HANDLE hFind = INVALID_HANDLE_VALUE;
|
HANDLE hFind = INVALID_HANDLE_VALUE;
|
||||||
|
|
||||||
// Start iterating over the files in the path directory.
|
// Start iterating over the files in the path directory.
|
||||||
hFind = ::FindFirstFileA((folder + "\\*.*").c_str(), &ffd);
|
hFind = ::FindFirstFileA((folder + "\\*").c_str(), &ffd);
|
||||||
if (hFind != INVALID_HANDLE_VALUE)
|
if (hFind != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
do // Managed to locate and create an handle to that folder.
|
do // Managed to locate and create an handle to that folder.
|
||||||
|
Loading…
Reference in New Issue
Block a user