agent/browser/ie/pagetest/PagetestReporting.cpp
/*-----------------------------------------------------------------------------
	Write out the browser status updates (tab-delimited)
-----------------------------------------------------------------------------*/
Write out the browser status updates (tab-delimited)
Write out the browser status updates ( tab - delimited )
void CPagetestReporting::SaveStatusUpdates(CString file)
{
	if( statusUpdates.GetCount() )
	{
		HANDLE hFile = CreateFile( file, GENERIC_WRITE, 0, &nullDacl, CREATE_ALWAYS, 0, 0);
		if( hFile != INVALID_HANDLE_VALUE )
		{
			POSITION pos = statusUpdates.GetHeadPosition();
			while( pos )
			{
				CStatusUpdate stat = statusUpdates.GetNext(pos);
				if( stat.tm > start )
				{
					DWORD ms = (DWORD)((stat.tm - start) / msFreq);
					CString buff;
					buff.Format(_T("%d\t"), ms);
					buff += stat.status;
					buff += _T("\r\n");
					DWORD bytes;
          CT2A str(buff, CP_UTF8);
					WriteFile(hFile, (LPCSTR)str, lstrlenA(str), &bytes, 0 );
				}
			}
			CloseHandle(hFile);
		}
	}
}
void CPagetestReporting :: SaveStatusUpdates ( CString file ) { if ( statusUpdates . GetCount ( ) ) { HANDLE hFile = CreateFile ( file , GENERIC_WRITE , 0 , & nullDacl , CREATE_ALWAYS , 0 , 0 ) ; if ( hFile != INVALID_HANDLE_VALUE ) { POSITION pos = statusUpdates . GetHeadPosition ( ) ; while ( pos ) { CStatusUpdate stat = statusUpdates . GetNext ( pos ) ; if ( stat . tm > start ) { DWORD ms = ( DWORD ) ( ( stat . tm - start ) / msFreq ) ; CString buff ; buff . Format ( _T ( " \t " ) , ms ) ; buff += stat . status ; buff += _T ( " \r \n " ) ; DWORD bytes ; CT2A str ( buff , CP_UTF8 ) ; WriteFile ( hFile , ( LPCSTR ) str , lstrlenA ( str ) , & bytes , 0 ) ; } } CloseHandle ( hFile ) ; } } }
Write out the browser status updates (tab-delimited)
Write out the browser status updates ( tab - delimited )