Skip to content

Commit c1606cb

Browse files
committed
missing utils include
1 parent d043281 commit c1606cb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/utilities/utils.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "hal_core/utilities/log.h"
44

5+
#include <algorithm>
56
#include <dirent.h>
67
#include <fstream>
78
#include <random>
@@ -37,11 +38,17 @@ namespace hal
3738
#ifdef _WIN32
3839
DWORD ftyp = GetFileAttributesA(folder.c_str());
3940
if (ftyp == INVALID_FILE_ATTRIBUTES)
41+
{
4042
return false; //something is wrong with your path!
43+
}
4144

4245
if (ftyp & FILE_ATTRIBUTE_DIRECTORY)
46+
{
4347
if (0 == access(folder.c_str(), R_OK))
48+
{
4449
return true;
50+
}
51+
}
4552

4653
return false; // this is not a directory!
4754
#else
@@ -65,7 +72,9 @@ namespace hal
6572
#ifdef _WIN32
6673
DWORD ret = GetModuleFileNameA(NULL, buf, sizeof(buf));
6774
if (ret == 0 || ret == sizeof(buf))
75+
{
6876
return std::string();
77+
}
6978
return std::filesystem::path(buf);
7079
#elif __APPLE__ && __MACH__
7180
uint32_t size = sizeof(buf);

0 commit comments

Comments
 (0)