Files
BlitzNext/Runtime/gfx/gxdir.cpp
T
Michael Fabian 'Xaymar' Dirks a16218e1d5 runtime: CMake-ify gx
2019-01-18 17:03:37 +01:00

23 lines
421 B
C++

#include "gxdir.hpp"
#include "std.hpp"
gxDir::gxDir(HANDLE h, const WIN32_FIND_DATA& f) : handle(h), findData(f) {}
gxDir::~gxDir()
{
if (handle != INVALID_HANDLE_VALUE)
FindClose(handle);
}
string gxDir::getNextFile()
{
if (handle == INVALID_HANDLE_VALUE)
return "";
string t = findData.cFileName;
if (!FindNextFile(handle, &findData)) {
FindClose(handle);
handle = INVALID_HANDLE_VALUE;
}
return t;
}