Subversion Repositories spk

Rev

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

Rev 102 Rev 111
Line 555... Line 555...
555
	return f;
555
	return f;
556
}
556
}
557
 
557
 
558
bool CCatFile::AppendFile(const Utils::String &filename, const Utils::String &sTo, bool pck, bool bXor, Utils::String *sChangeTo)
558
bool CCatFile::AppendFile(const Utils::String &filename, const Utils::String &sTo, bool pck, bool bXor, Utils::String *sChangeTo)
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.filename().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.fullFilename().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;
Line 868... Line 868...
868
		checkFile = checkFile.FindReplace ( "//", "/" );
868
		checkFile = checkFile.FindReplace ( "//", "/" );
869
		tofile = checkFile.GetToken("/", checkFile.NumToken('/'));
869
		tofile = checkFile.GetToken("/", checkFile.NumToken('/'));
870
 
870
 
871
		if ( !checkFile.IsIn(".") || preserve )
871
		if ( !checkFile.IsIn(".") || preserve )
872
		{
872
		{
873
			tofile = fo.GetFilename();
873
			tofile = fo.filename();
874
			todir = checkFile;
874
			todir = checkFile;
875
		}
875
		}
876
		else
876
		else
877
		{
877
		{
878
			todir = CFileIO(checkFile).dir();
878
			todir = CFileIO(checkFile).dir();
Line 882... Line 882...
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.filename();
888
		todir = CFileIO(tofile).dir();
888
		todir = CFileIO(tofile).dir();
889
		tofile = CFileIO(tofile).filename();
889
		tofile = CFileIO(tofile).filename();
890
	}
890
	}
891
	
891
	
892
	if ( preserve )
892
	if ( preserve )
Line 898... Line 898...
898
			todir += fo.dir();
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.filename();
904
 
904
 
905
	bool bWritten = false;
905
	bool bWritten = false;
906
 
906
 
907
	// create the directory to extract to
907
	// create the directory to extract to
908
	if ( !todir.Empty() && !CDirIO(todir).Create() )
908
	if ( !todir.Empty() && !CDirIO(todir).Create() )