Subversion Repositories spk

Rev

Rev 227 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 227 Rev 302
Line 358... Line 358...
358
		}
358
		}
359
	}
359
	}
360
	return false;
360
	return false;
361
}
361
}
362
 
362
 
363
bool CDirIO::dirList(Utils::WStringList& files, const Utils::WString &sDir, const Utils::WString &filePattern) const
363
bool CDirIO::dirList(Utils::WStringList& files, const Utils::WString &sDir, const Utils::WString &filePattern, bool absolutePath) const
364
{
364
{
365
	Utils::WString dir = _parseDir(sDir);
365
	Utils::WString dir = _parseDir(sDir);
366
	if (dir.empty())
366
	if (dir.empty())
367
		return false;
367
		return false;
368
 
368
 
Line 373... Line 373...
373
	{
373
	{
374
		dir += L"/";
374
		dir += L"/";
375
		dir += filePattern;
375
		dir += filePattern;
376
	}
376
	}
377
	dir = dir.findReplace(L"//", L"/");
377
	dir = dir.findReplace(L"//", L"/");
-
 
378
 
-
 
379
	CFileIO F(dir);	
378
 
380
 
379
#ifdef _WIN32
381
#ifdef _WIN32
380
	dir = dir.findReplace(L"/", L"\\");
382
	dir = dir.findReplace(L"/", L"\\");
381
 
383
 
382
	WIN32_FIND_DATA data;
384
	WIN32_FIND_DATA data;
383
	HANDLE h = FindFirstFile(dir.c_str(), &data);
385
	HANDLE h = FindFirstFile(dir.c_str(), &data);
384
	if (h != INVALID_HANDLE_VALUE)
386
	if (h != INVALID_HANDLE_VALUE)
385
	{
387
	{
386
		Utils::WString checkFile(data.cFileName);
388
		Utils::WString checkFile(data.cFileName);
387
		if (!checkFile.Compare(L".") && !checkFile.Compare(L".."))
389
		if (!checkFile.Compare(L".") && !checkFile.Compare(L".."))
388
			files.pushBack(checkFile);
390
			files.pushBack(absolutePath ? F.GetDirIO().file(checkFile) : checkFile);
389
 
391
 
390
		while (FindNextFile(h, &data))
392
		while (FindNextFile(h, &data))
391
		{
393
		{
392
			Utils::WString checkFile(data.cFileName);
394
			Utils::WString checkFile(data.cFileName);
393
			if (checkFile != L"." && checkFile != L"..")
395
			if (checkFile != L"." && checkFile != L"..")
394
				files.pushBack(checkFile);
396
				files.pushBack(absolutePath ? F.GetDirIO().file(checkFile) : checkFile);
395
		}
397
		}
396
 
398
 
397
		FindClose(h);
399
		FindClose(h);
398
		return true;
400
		return true;
399
	}
401
	}