Files
BlitzNext/gxruntime/gxdir.cpp
T
blitz-research 08a613ed0e Initial commit.
2014-01-31 08:23:00 +13:00

20 lines
408 B
C++

#include "std.h"
#include "gxdir.h"
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;
}