MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / QueryByFilename

Method QueryByFilename

Source/Interface/RomDB.cpp:480–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480bool IRomDB::QueryByFilename( const char * filename, RomID * id, u32 * rom_size, ECicType * cic_type )
481{
482 //
483 // First of all, check if we have these details cached in the rom database
484 //
485 FilenameVec::const_iterator fit( std::lower_bound( mRomFiles.begin(), mRomFiles.end(), filename, SSortByFilename() ) );
486 if( fit != mRomFiles.end() && strcmp( fit->FileName, filename ) == 0 )
487 {
488 if( QueryByID( fit->ID, rom_size, cic_type ) )
489 {
490 *id = fit->ID;
491 return true;
492 }
493 }
494
495 if( GenerateRomDetails( filename, id, rom_size, cic_type ) )
496 {
497 //
498 // Store this information for future reference
499 //
500 AddRomEntry( filename, *id, *rom_size, *cic_type );
501 return true;
502 }
503
504 return false;
505}
506
507bool IRomDB::QueryByID( const RomID & id, u32 * rom_size, ECicType * cic_type ) const
508{

Callers 1

Calls 2

SSortByFilenameClass · 0.85
GenerateRomDetailsFunction · 0.85

Tested by

no test coverage detected