diff options
Diffstat (limited to 'Runtime/FileSystem/FileJobs.cpp')
-rw-r--r-- | Runtime/FileSystem/FileJobs.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Runtime/FileSystem/FileJobs.cpp b/Runtime/FileSystem/FileJobs.cpp new file mode 100644 index 0000000..29e99a4 --- /dev/null +++ b/Runtime/FileSystem/FileJobs.cpp @@ -0,0 +1,27 @@ +#include <fstream> +#include "FileJobs.h" + +using namespace std; + +void ReadFilesJob::Dispacth(void* param) +{ + LUA_BIND_STATE((lua_State*)param); + if (!callback) + return; + callback.PushRef(state); + state.Call(0, 0); +} + +void ReadFilesJob::Process() +{ + if (IsFinished()) + return; + ifstream infile; + infile.open(files[cur]); + ++cur; +} + +bool ReadFilesJob::IsFinished() +{ + return cur >= files.size(); +}
\ No newline at end of file |