Subversion Repositories spk

Rev

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

Rev 101 Rev 102
Line 559... Line 559...
559
{
559
{
560
	CLog::logf(CLog::Log_IO, 1, "CCatFile::AppendFile() Adding file, %s, into cat file, %s::%s [PCK:%s XOR:%s]", filename.c_str(), this->m_fCatFile.GetFilename().ToString().c_str(), sTo.c_str(), (pck) ? "Yes" : "No", (bXor) ? "Yes" : "No");
560
	CLog::logf(CLog::Log_IO, 1, "CCatFile::AppendFile() Adding file, %s, into cat file, %s::%s [PCK:%s XOR:%s]", filename.c_str(), this->m_fCatFile.GetFilename().ToString().c_str(), sTo.c_str(), (pck) ? "Yes" : "No", (bXor) ? "Yes" : "No");
561
 
561
 
562
	if ( filename.isin ( "::" ) ) return WriteFromCat ( filename.token("::", 1), filename.token("::", 2));
562
	if ( filename.isin ( "::" ) ) return WriteFromCat ( filename.token("::", 1), filename.token("::", 2));
563
	if ( (!m_bCreate) && (!m_fDatFile.exists ()) ) {
563
	if ( (!m_bCreate) && (!m_fDatFile.exists ()) ) {
564
		CLog::logf(CLog::Log_IO, 2, "CCatFile::AppendFile() Cat File: %s, doesn't exist, quitting...", m_fCatFile.GetFullFilename().ToString().c_str());
564
		CLog::logf(CLog::Log_IO, 2, "CCatFile::AppendFile() Cat File: %s, doesn't exist, quitting...", m_fCatFile.fullFilename().c_str());
565
		return false;
565
		return false;
566
	}
566
	}
567
	CyString to = sTo;
567
	CyString to = sTo;
568
	if ( !m_sAddonDir.Empty() && CCatFile::IsAddonDir(to) ) {
568
	if ( !m_sAddonDir.Empty() && CCatFile::IsAddonDir(to) ) {
569
		CLog::logf(CLog::Log_IO, 3, "CCatFile::AppendFile() changing destination to included addon fir, %s => %s", to, m_sAddonDir + "/" + to);
569
		CLog::logf(CLog::Log_IO, 3, "CCatFile::AppendFile() changing destination to included addon fir, %s => %s", to, m_sAddonDir + "/" + to);
Line 873... Line 873...
873
			tofile = fo.GetFilename();
873
			tofile = fo.GetFilename();
874
			todir = checkFile;
874
			todir = checkFile;
875
		}
875
		}
876
		else
876
		else
877
		{
877
		{
878
			todir = CFileIO(checkFile).GetDir();
878
			todir = CFileIO(checkFile).dir();
879
			tofile = CFileIO(checkFile).GetFilename();
879
			tofile = CFileIO(checkFile).filename();
880
		}
880
		}
881
	}
881
	}
882
 
882
 
883
	if ( tofile.Empty() )
883
	if ( tofile.Empty() )
884
	{
884
	{
885
		if ( !tofile.Empty() )
885
		if ( !tofile.Empty() )
886
			tofile += "/";
886
			tofile += "/";
887
		tofile += fo.GetFilename();
887
		tofile += fo.GetFilename();
888
		todir = CFileIO(tofile).GetDir();
888
		todir = CFileIO(tofile).dir();
889
		tofile = CFileIO(tofile).GetFilename();
889
		tofile = CFileIO(tofile).filename();
890
	}
890
	}
891
	
891
	
892
	if ( preserve )
892
	if ( preserve )
893
	{
893
	{
894
		if ( !fo.GetDir().Compare(todir.Right(- (int)fo.GetDir().Length())) )
894
		if ( !fo.dir().Compare(todir.Right(- (int)fo.dir().length()).ToString()) )
895
		{
895
		{
896
			if ( !todir.Empty() && todir.Right(1) != "/" )
896
			if ( !todir.Empty() && todir.Right(1) != "/" )
897
				todir += "/";
897
				todir += "/";
898
			todir += fo.GetDir();
898
			todir += fo.dir();
899
		}
899
		}
900
	}
900
	}
901
 
901
 
902
	if ( tofile.Empty() )
902
	if ( tofile.Empty() )
903
		tofile = fo.GetFilename();
903
		tofile = fo.GetFilename();