mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
refs #290 using a CRange of iterator adaptors in implementating the tertiary predicate-based methods of the derived containers,
but preserving the return-by-copy for API stability
This commit is contained in:
@@ -17,13 +17,7 @@ namespace BlackSim
|
||||
|
||||
QStringList CSimulatorInfoList::toStringList(bool i18n) const
|
||||
{
|
||||
QStringList infoList;
|
||||
foreach(CSimulatorInfo info, (*this))
|
||||
{
|
||||
QString i = info.toQString(i18n);
|
||||
infoList.append(i);
|
||||
}
|
||||
return infoList;
|
||||
return this->transform([i18n](const CSimulatorInfo &info) { return info.toQString(i18n); });
|
||||
}
|
||||
|
||||
void CSimulatorInfoList::registerMetadata()
|
||||
|
||||
@@ -20,9 +20,14 @@ namespace BlackSim
|
||||
return this->m_mappings;
|
||||
}
|
||||
|
||||
BlackMisc::Network::CAircraftMappingList ISimulatorModelMappings::findByIcao(const BlackMisc::Aviation::CAircraftIcao &icao, bool emptyMeansWildCard) const
|
||||
BlackMisc::Network::CAircraftMappingList ISimulatorModelMappings::findByIcaoWildcard(const BlackMisc::Aviation::CAircraftIcao &icao) const
|
||||
{
|
||||
return this->m_mappings.findByIcaoCode(icao, emptyMeansWildCard);
|
||||
return this->m_mappings.findByIcaoCodeWildcard(icao);
|
||||
}
|
||||
|
||||
BlackMisc::Network::CAircraftMappingList ISimulatorModelMappings::findByIcaoExact(const BlackMisc::Aviation::CAircraftIcao &icao) const
|
||||
{
|
||||
return this->m_mappings.findByIcaoCodeExact(icao);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -37,8 +37,11 @@ namespace BlackSim
|
||||
//! Get list
|
||||
const BlackMisc::Network::CAircraftMappingList &getMappingList() const;
|
||||
|
||||
//! Find by ICAO code
|
||||
BlackMisc::Network::CAircraftMappingList findByIcao(const BlackMisc::Aviation::CAircraftIcao &icao, bool emptyMeansWildCard = true) const;
|
||||
//! Find by ICAO code, empty fields are treated as wildcards
|
||||
BlackMisc::Network::CAircraftMappingList findByIcaoWildcard(const BlackMisc::Aviation::CAircraftIcao &icao) const;
|
||||
|
||||
//! Find by ICAO code, empty fields are treated literally
|
||||
BlackMisc::Network::CAircraftMappingList findByIcaoExact(const BlackMisc::Aviation::CAircraftIcao &icao) const;
|
||||
|
||||
protected:
|
||||
BlackMisc::Network::CAircraftMappingList m_mappings; //!< Mappings
|
||||
|
||||
Reference in New Issue
Block a user