const FP_LIB_TABLE::ROW* FP_LIB_TABLE::FindRowByURI( const wxString& aURI ) { FP_LIB_TABLE* cur = this; do { cur->ensureIndex(); for( unsigned i = 0; i < cur->rows.size(); i++ ) { wxString uri = cur->rows[i].GetFullURI( true ); if( wxFileName::GetPathSeparator() == wxChar( '\\' ) && uri.Find( wxChar( '/' ) ) >= 0 ) uri.Replace( wxT( "/" ), wxT( "\\" ) ); if( (wxFileName::IsCaseSensitive() && uri == aURI) || (!wxFileName::IsCaseSensitive() && uri.Upper() == aURI.Upper() ) ) { return &cur->rows[i]; // found } } // not found, search fall back table(s), if any } while( ( cur = cur->fallBack ) != 0 ); return 0; // not found }
FP_LIB_TABLE::ROW* FP_LIB_TABLE::findRow( const wxString& aNickName ) const { FP_LIB_TABLE* cur = (FP_LIB_TABLE*) this; do { cur->ensureIndex(); INDEX_CITER it = cur->nickIndex.find( aNickName ); if( it != cur->nickIndex.end() ) { return &cur->rows[it->second]; // found } // not found, search fall back table(s), if any } while( ( cur = cur->fallBack ) != 0 ); return 0; // not found }