Subversion Repositories spk

Rev

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

Rev 158 Rev 160
Line 96... Line 96...
96
		return true;
96
		return true;
97
 
97
 
98
	// make sure the directory exissts
98
	// make sure the directory exissts
99
	if ( !oDir.exists(newDir) )
99
	if ( !oDir.exists(newDir) )
100
	{
100
	{
101
		if ( !oDir.Create(newDir) )
101
		if ( !oDir.create(newDir) )
102
		{
102
		{
103
			CLog::logf(CLog::Log_Install, 2, "Unable to create directory to backup original files, %s", newDir.c_str());
103
			CLog::logf(CLog::Log_Install, 2, "Unable to create directory to backup original files, %s", newDir.c_str());
104
			AddLogEntry(SPKINSTALL_CREATEDIRECTORY_FAIL, newDir, errors);
104
			AddLogEntry(SPKINSTALL_CREATEDIRECTORY_FAIL, newDir, errors);
105
			return false;
105
			return false;
106
		}
106
		}
Line 221... Line 221...
221
		_storeFiles(FILETYPE_SOUND, "soundtrack", pFiles);
221
		_storeFiles(FILETYPE_SOUND, "soundtrack", pFiles);
222
		_storeFiles(FILETYPE_EXTRA, "mov", pFiles);
222
		_storeFiles(FILETYPE_EXTRA, "mov", pFiles);
223
	}
223
	}
224
}
224
}
225
 
225
 
226
bool COriginalFiles::writeData(CyStringList *lines)
226
bool COriginalFiles::writeData(Utils::CStringList &lines)
227
{
227
{
228
	bool addAny = false;
228
	bool addAny = false;
229
 
229
 
230
	if ( !_lFiles.empty() )
230
	if ( !_lFiles.empty() )
231
	{
231
	{
Line 238... Line 238...
238
 
238
 
239
			// add the directory for Extra files
239
			// add the directory for Extra files
240
			if ( uf->GetFileType() == FILETYPE_EXTRA && !uf->GetDir().Empty())
240
			if ( uf->GetFileType() == FILETYPE_EXTRA && !uf->GetDir().Empty())
241
			{
241
			{
242
				uString += ":";
242
				uString += ":";
243
				uString += uf->GetDir().ToString();
243
				uString += uf->dir();
244
			}
244
			}
245
 
245
 
246
			lines->PushBack(CyString(uString));
246
			lines.pushBack(uString);
247
			addAny = true;
247
			addAny = true;
248
		}
248
		}
249
	}
249
	}
250
 
250
 
251
	return addAny;
251
	return addAny;
Line 277... Line 277...
277
			break;
277
			break;
278
	}
278
	}
279
 
279
 
280
	CDirIO Dir(_sDir + "/" + searchPath);
280
	CDirIO Dir(_sDir + "/" + searchPath);
281
 
281
 
282
	CyStringList *files = Dir.DirList();
282
	Utils::CStringList files;
-
 
283
	Dir.dirList(files);
283
	if ( !files )
284
	if (files.empty())
284
		return;
285
		return;
285
 
286
 
286
	for ( SStringList *node = files->Head(); node; node = node->;next )
287
	for(auto itr = files.begin(); itr != files.end(); itr++)
287
	{
288
	{
288
		CFileIO File(Dir.File(node->str));
289
		CFileIO File(Dir.file((*itr)->str));
289
 
-
 
290
		
290
		
291
		if ( File.extension().Compare(ext) )
291
		if ( File.extension().Compare(ext) )
292
			_add(filetype, File.filename(), searchPath, pFiles);
292
			_add(filetype, File.filename(), searchPath, pFiles);
293
	}
293
	}
294
 
-
 
295
	delete files;
-
 
296
}
294
}
297
 
295
 
298
/**
296
/**
299
 * Get original file
297
 * Get original file
300
 *
298
 *
Line 356... Line 354...
356
 
354
 
357
	// add the file entry to the list
355
	// add the file entry to the list
358
	C_File *of = new C_File(filename);
356
	C_File *of = new C_File(filename);
359
	of->setFileType(filetype);
357
	of->setFileType(filetype);
360
	if (filetype == FILETYPE_EXTRA)
358
	if (filetype == FILETYPE_EXTRA)
361
		of->SetDir(searchPath);
359
		of->setDir(searchPath);
362
	of->SetFilename(_sDir + "/" + of->GetNameDirectory(NULL).ToString());
360
	of->setFilename(_sDir + "/" + of->getNameDirectory(NULL));
363
 
361
 
364
	_lFiles.push_back(of);
362
	_lFiles.push_back(of);
365
}
363
}
366
 
364
 
367
void COriginalFiles::_storeOverride(C_File *f)
365
void COriginalFiles::_storeOverride(C_File *f)
368
{
366
{
369
	CDirIO oDir(_sDir + "/PluginManager/Original/Replacements");
367
	CDirIO oDir(_sDir + "/PluginManager/Original/Replacements");
370
	if ( !oDir.exists() ) oDir.Create();
368
	if ( !oDir.exists() ) oDir.create();
371
	CFileIO file(oDir.file(f->GetNameDirectory(NULL).ToString()));
369
	CFileIO file(oDir.file(f->getNameDirectory(NULL)));
372
	if ( !file.GetDirIO().exists() ) file.GetDirIO().Create();
370
	if ( !file.GetDirIO().exists() ) file.GetDirIO().create();
373
	CFileIO fromFile(f->GetFilePointer());
371
	CFileIO fromFile(f->filePointer());
374
	fromFile.copy(file.fullFilename(), true);
372
	fromFile.copy(file.fullFilename(), true);
375
}
373
}
376
 
374
 
377
}
375
}