MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / pathExistsFile

Function pathExistsFile

Libraries/Testing/Testing.cpp:151–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151static bool pathExistsFile(StringSpan path)
152{
153#if SC_PLATFORM_WINDOWS
154 const DWORD attr = ::GetFileAttributesW(path.getNullTerminatedNative());
155 return attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY) == 0;
156#else
157 struct stat info;
158 return ::stat(path.getNullTerminatedNative(), &info) == 0 && S_ISREG(info.st_mode);
159#endif
160}
161
162static bool pathExistsDirectory(StringSpan path)
163{

Callers 1

repoHasMarkersFunction · 0.85

Calls 1

statClass · 0.70

Tested by

no test coverage detected