| 478 | } |
| 479 | |
| 480 | bool 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 | |
| 507 | bool IRomDB::QueryByID( const RomID & id, u32 * rom_size, ECicType * cic_type ) const |
| 508 | { |
no test coverage detected