Subversion Repositories spk

Rev

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

Rev 1 Rev 35
Line 15... Line 15...
15
}
15
}
16
 
16
 
17
bool CModDiff::LoadDirectory(CyString &dir)
17
bool CModDiff::LoadDirectory(CyString &dir)
18
{
18
{
19
	m_sCurrentDir = dir;
19
	m_sCurrentDir = dir;
20
	return m_fileSystem.LoadFilesystem(dir, NullString, m_iMaxPatch);
20
	return m_fileSystem.LoadFilesystem(dir.ToString(), m_iMaxPatch);
21
}
21
}
22
 
22
 
23
bool CModDiff::CreateDiff(CyString &modfile)
23
bool CModDiff::CreateDiff(CyString &modfile)
24
{
24
{
25
	ClearError();
25
	ClearError();
Line 44... Line 44...
44
			// extract the file to the temp dir
44
			// extract the file to the temp dir
45
			CyString toFile = CFileIO(m_sTempDir + "/" + CFileIO(f->sFile).GetFilename()).GetFullFilename();
45
			CyString toFile = CFileIO(m_sTempDir + "/" + CFileIO(f->sFile).GetFilename()).GetFullFilename();
46
			if ( cat.ExtractFile(f, toFile ) )
46
			if ( cat.ExtractFile(f, toFile ) )
47
			{
47
			{
48
				// now extract the matching file from the game dir
48
				// now extract the matching file from the game dir
49
				if ( m_fileSystem.ExtractGameFile(f->sFile, toFile + ".compare") )
49
				if ( m_fileSystem.ExtractGameFile(f->sFile.ToString(), (toFile + ".compare").ToString()) )
50
				{
50
				{
51
					DiffFile(toFile + ".compare", toFile, f->sFile);
51
					DiffFile(toFile + ".compare", toFile, f->sFile);
52
					CFileIO(toFile + ".compare").Remove();
52
					CFileIO(toFile + ".compare").Remove();
53
				}
53
				}
54
				// make sure we clear up afterwards
54
				// make sure we clear up afterwards
Line 282... Line 282...
282
	return false;
282
	return false;
283
}
283
}
284
 
284
 
285
bool CModDiff::ApplyMod(CyString &mod)
285
bool CModDiff::ApplyMod(CyString &mod)
286
{
286
{
287
	return m_fileSystem.LoadMod(mod);
287
	return m_fileSystem.addMod(mod.ToString());
288
}
288
}
289
 
289
 
290
bool CModDiff::ApplyDiff(CyString &mod)
290
bool CModDiff::ApplyDiff(CyString &mod)
291
{
291
{
292
	if ( m_lFiles.empty() ) return false;
292
	if ( m_lFiles.empty() ) return false;
Line 353... Line 353...
353
 
353
 
354
bool CModDiff::ReadGameFile(CyString &file, CyStringList *writeLines, int *id)
354
bool CModDiff::ReadGameFile(CyString &file, CyStringList *writeLines, int *id)
355
{
355
{
356
	bool ret = false;
356
	bool ret = false;
357
 
357
 
358
	if ( m_fileSystem.ExtractGameFile(file, m_sTempDir + "/" + CFileIO(file).GetFilename()) )
358
	if ( m_fileSystem.ExtractGameFile(file.ToString(), (m_sTempDir + "/" + CFileIO(file).GetFilename()).ToString()) )
359
	{
359
	{
360
		CFileIO File(m_sTempDir + "/" + CFileIO(file).GetFilename());
360
		CFileIO File(m_sTempDir + "/" + CFileIO(file).GetFilename());
361
 
361
 
362
		CyStringList *lines = File.ReadLinesStr();
362
		CyStringList *lines = File.ReadLinesStr();
363
		if ( lines )
363
		if ( lines )