summaryrefslogtreecommitdiff
path: root/Runtime/FileSystem/FileJobs.cpp
blob: 554dc5ba638c854d182f13fe26a42ecdc1a934e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#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();
}