Subversion Repositories spk

Rev

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

Rev 41 Rev 42
Line 544... Line 544...
544
		return fo.ChangeFileExtension ( "pbd" );
544
		return fo.ChangeFileExtension ( "pbd" );
545
 
545
 
546
	return f;
546
	return f;
547
}
547
}
548
 
548
 
549
bool CCatFile::AppendFile ( CyString filename, CyString to, bool pck, bool bXor )
549
bool CCatFile::AppendFile ( CyString filename, CyString to, bool pck, bool bXor, CyString *sChangeTo)
550
{
550
{
551
	if ( (!m_bCreate) && (!m_fCatFile.Exists ()) )
551
	if ( (!m_bCreate) && (!m_fCatFile.Exists ()) )
552
		return false;
552
		return false;
553
 
553
 
554
	if ( !m_sAddonDir.Empty() && CCatFile::IsAddonDir(to) ) {
554
	if ( !m_sAddonDir.Empty() && CCatFile::IsAddonDir(to) ) {
Line 563... Line 563...
563
	if ( !id )
563
	if ( !id )
564
		return false;
564
		return false;
565
	fclose ( id );
565
	fclose ( id );
566
 
566
 
567
	// then check if the file already exists
567
	// then check if the file already exists
-
 
568
	/*
568
	if ( !m_lFiles.empty() )
569
	if ( !m_lFiles.empty() )
569
	{
570
	{
570
		SInCatFile *f = FindData ( to );
571
		SInCatFile *f = FindData ( to );
571
		if ( f )
572
		if ( f )
572
		{
573
		{
573
			if ( !RemoveFile ( f ) )
574
			if ( !RemoveFile ( f ) )
574
				return false;
575
				return false;
575
		}
576
		}
576
	}
577
	}*/
577
 
578
 
-
 
579
	// change the file extension and remove the file again
-
 
580
	if ( pck && CheckExtensionPck(filename) ) {
-
 
581
		to = PckChangeExtension ( to );
-
 
582
	}
-
 
583
 
-
 
584
	if ( sChangeTo ) {
-
 
585
		*sChangeTo = to;
-
 
586
	}
-
 
587
 
-
 
588
	if ( !m_lFiles.empty() ) {
-
 
589
		SInCatFile *checkf = FindData ( to );
-
 
590
		if ( checkf ) {
-
 
591
			if ( !RemoveFile ( checkf ) ) return false;
-
 
592
		}
-
 
593
	}
-
 
594
 
578
	bool append = false;
595
	bool append = false;
579
 
596
 
580
	SInCatFile *f = new SInCatFile;
597
	SInCatFile *f = new SInCatFile;
581
	f->sData = 0;
598
	f->sData = 0;
582
	f->lOffset = this->GetEndOffset();
599
	f->lOffset = this->GetEndOffset();
583
 
600
 
584
	bool dofile = true;
601
	bool dofile = true;
585
	if ( pck && CheckExtensionPck(filename) )
-
 
586
	{
-
 
587
		to = PckChangeExtension ( to );
-
 
588
 
-
 
589
		if ( !m_lFiles.empty() )
-
 
590
		{
-
 
591
			SInCatFile *checkf = FindData ( to );
-
 
592
			if ( checkf )
-
 
593
			{
-
 
594
				if ( !RemoveFile ( checkf ) )
-
 
595
					return false;
-
 
596
			}
-
 
597
		}
-
 
598
	}
-
 
599
 
602
 
600
	if ( !m_lFiles.size() )
603
	if ( !m_lFiles.size() )
601
		m_fDatFile.WipeFile();
604
		m_fDatFile.WipeFile();
602
 
605
 
603
//	if ( CheckPackedExtension(to) && !CheckPackedExtension(filename) )
606
//	if ( CheckPackedExtension(to) && !CheckPackedExtension(filename) )