/* ============ sdGUIDFile::CheckForUpdates ============ */ void sdGUIDFile::CheckForUpdates( bool removeOldEntries ) { idFile* file = fileSystem->OpenFileRead( guidFileName ); if ( !file ) { return; } bool changed = file->Timestamp() != fileTimestamp; fileTimestamp = file->Timestamp(); fileSystem->CloseFile( file ); if ( !changed ) { return; } ClearGUIDStates(); idLexer src( LEXFL_NOSTRINGCONCAT | LEXFL_NOSTRINGESCAPECHARS | LEXFL_ALLOWPATHNAMES | LEXFL_ALLOWMULTICHARLITERALS | LEXFL_ALLOWBACKSLASHSTRINGCONCAT | LEXFL_NOFATALERRORS ); src.LoadFile( guidFileName ); if ( !src.IsLoaded() ) { return; } idToken token; while ( true ) { if ( !src.ReadToken( &token ) ) { break; } if ( !token.Icmp( "entry" ) ) { if ( !ParseEntry( src ) ) { src.Warning( "Error Parsing Entry" ); break; } } else { src.Warning( "Invalid Token '%s'", token.c_str() ); break; } } if ( removeOldEntries ) { RemoveOldEntries(); } }
void CMainFrmThread::OnDeleteEntries() { RemoveOldEntries(); }