Subversion Repositories spk

Rev

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

Rev 89 Rev 91
Line 172... Line 172...
172
	return NULL;
172
	return NULL;
173
}
173
}
174
 
174
 
175
int CBaseFile::CheckFile ( CyString filename, float *version )
175
int CBaseFile::CheckFile ( CyString filename, float *version )
176
{
176
{
177
	std::fstream File(filename.ToString().c_str(), std::ios::in | std::ios::binary);
177
	CFileIO File(filename);
178
	if ( !File.is_open() ) return 0;
178
	if ( !File.startRead() ) return 0;
179
 
-
 
180
	Utils::String line = CBaseFile::readEndOfLine(File, NULL, false);
179
	Utils::String line = File.readEndOfLine();
181
	Utils::String type = line.token(";", 1);
180
	Utils::String type = line.token(";", 1);
182
	File.close();
181
	File.close();
183
 
182
 
184
	// check for old version
183
	// check for old version
185
	if ( line.left(3) == "HiP" ) return SPKFILE_OLD;
184
	if ( line.left(3) == "HiP" ) return SPKFILE_OLD;
Line 519... Line 518...
519
		fullsize += m_pIconFile->GetUncompressedDataSize();
518
		fullsize += m_pIconFile->GetUncompressedDataSize();
520
 
519
 
521
	return fullsize;
520
	return fullsize;
522
}
521
}
523
 
522
 
524
 
-
 
525
Utils::String CBaseFile::readEndOfLine(std::fstream &stream, int *line, bool upper )
-
 
526
{
-
 
527
	Utils::String str;
-
 
528
	std::getline(stream, str, '\n');
-
 
529
	if ( line ) ++(*line);
-
 
530
	if ( upper ) return str.upper();
-
 
531
	return str;
-
 
532
}
-
 
533
/*
523
/*
534
	Func:   GetEndOfLine
524
	Func:   GetEndOfLine
535
	Input:  id - The file id for the current file to read from
525
	Input:  id - The file id for the current file to read from
536
	        line - Pointed to hold the line number thats read
526
	        line - Pointed to hold the line number thats read
537
			upper - true if it converts to uppercase
527
			upper - true if it converts to uppercase