MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / isFile

Method isFile

source/core/StarFile_windows.cpp:62–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62bool File::isFile(String const& path) {
63 WIN32_FIND_DATAW findFileData;
64 const HANDLE handle = FindFirstFileW(stringToUtf16(path).get(), &findFileData);
65 if (handle == INVALID_HANDLE_VALUE)
66 return false;
67 FindClose(handle);
68 return (FILE_ATTRIBUTE_DIRECTORY & findFileData.dwFileAttributes) == 0;
69}
70
71bool File::isDirectory(String const& path) {
72 DWORD attribs = GetFileAttributesW(stringToUtf16(path.trimEnd("\\/")).get());

Callers

nothing calls this directly

Calls 2

stringToUtf16Function · 0.85
getMethod · 0.45

Tested by

no test coverage detected