Subversion Repositories spk

Rev

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

Rev 102 Rev 119
Line 272... Line 272...
272
		}
272
		}
273
		return true;
273
		return true;
274
	}
274
	}
275
 
275
 
276
	return false;
276
	return false;
-
 
277
}
-
 
278
 
-
 
279
Utils::CStringList *CDirIO::dirList(Utils::String dir, Utils::String filePattern)
-
 
280
{
-
 
281
	dir = parseDir(dir);
-
 
282
	if ( dir.empty() )
-
 
283
		return 0;
-
 
284
 
-
 
285
	Utils::CStringList *files = new Utils::CStringList();
-
 
286
 
-
 
287
#ifdef _WIN32
-
 
288
	dir = dir.findReplace("/", "\\");
-
 
289
	if ( filePattern.empty() )
-
 
290
		dir += "\\*";
-
 
291
	else
-
 
292
	{
-
 
293
		dir += "\\";
-
 
294
		dir += filePattern;
-
 
295
	}
-
 
296
	dir = dir.findReplace("\\\\", "\\");
-
 
297
 
-
 
298
	WIN32_FIND_DATA data;
-
 
299
	TCHAR buf[5000];
-
 
300
	wsprintf(buf, L"%hs", dir.c_str());
-
 
301
 
-
 
302
	HANDLE h = FindFirstFile(buf, &data);
-
 
303
	if ( h != INVALID_HANDLE_VALUE)
-
 
304
	{
-
 
305
		std::wstring ws(data.cFileName);
-
 
306
		std::string s(ws.begin(), ws.end());
-
 
307
 
-
 
308
		Utils::String checkFile(s);
-
 
309
		if ( !checkFile.Compare(".") && !checkFile.Compare("..") )
-
 
310
			files->pushBack(checkFile);
-
 
311
 
-
 
312
		while ( FindNextFile(h, &data) )
-
 
313
		{
-
 
314
			std::wstring ws(data.cFileName);
-
 
315
			std::string s(ws.begin(), ws.end());
-
 
316
 
-
 
317
			Utils::String checkFile(s);
-
 
318
			if ( checkFile != "." && checkFile != ".." )
-
 
319
				files->pushBack(checkFile);
-
 
320
		}
-
 
321
 
-
 
322
		FindClose(h);
-
 
323
	}
-
 
324
#else
-
 
325
 
-
 
326
#endif//_WIN32
-
 
327
 
-
 
328
	return files;
277
}
329
}
278
 
330
 
279
CyStringList *CDirIO::DirList(CyString dir, CyString filepattern)
331
CyStringList *CDirIO::DirList(CyString dir, CyString filepattern)
280
{
332
{
281
	dir = ParseDir(dir);
333
	dir = ParseDir(dir);