BOOL CFileHeader::Save(CFileWriter* pcWriter, const char* szWriterType, const char* szWriterVersion)
{
	if (!CheckHeaderSize(__METHOD__))
	{
		return FALSE;
	}

	memset(this, 0, sizeof(CFileHeader));

	StrCpySafe(mszCodaphela, ENGINE_NAME, FILE_HEADER_CODAPHELA_SIZE);
	StrCpySafe(mszEngineVersion, ENGINE_VERSION, FILE_HEADER_ENGINE_VERSION_SIZE);
	StrCpySafe(mszWriterType, szWriterType, FILE_HEADER_WRITER_TYPE_SIZE);
	StrCpySafe(mszWriterVersion, szWriterVersion, FILE_HEADER_WRITER_VERSION_SIZE);

	return pcWriter->WriteData(this, sizeof(CFileHeader));
}
char* MethodToString(char* szFile, int iLine, char* szFunction)
{
	int		iCount = IncrementLogToStringCount();
	char*	sz = gaszLogToStringScratchPad[iCount];

	CChars		szOutput;
	CFileUtil	cFileUtil;

	szOutput.Init();
	szOutput.Append(szFile);
	cFileUtil.RemovePath(&szOutput);
	szOutput.Insert(0, '(');
	szOutput.Append(':');
	szOutput.Append(iLine);
	szOutput.Append(") ");
	szOutput.Append(szFunction);

	StrCpySafe(sz, szOutput.Text(), LOG_TO_STRING_MAX_LENGTH);
	szOutput.Kill();

	return sz;
}