mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 09:15:34 +08:00
Use nested namespaces (C++17 feature)
This commit is contained in:
@@ -14,37 +14,34 @@
|
||||
#include <algorithm>
|
||||
#include <tuple>
|
||||
|
||||
namespace BlackMisc
|
||||
namespace BlackMisc::Simulation
|
||||
{
|
||||
namespace Simulation
|
||||
CSimulatorPluginInfoList::CSimulatorPluginInfoList() { }
|
||||
|
||||
bool CSimulatorPluginInfoList::supportsSimulator(const QString &simulator) const
|
||||
{
|
||||
CSimulatorPluginInfoList::CSimulatorPluginInfoList() { }
|
||||
|
||||
bool CSimulatorPluginInfoList::supportsSimulator(const QString &simulator) const
|
||||
return std::find_if(begin(), end(), [&simulator](const CSimulatorPluginInfo & info)
|
||||
{
|
||||
return std::find_if(begin(), end(), [&simulator](const CSimulatorPluginInfo & info)
|
||||
{
|
||||
return info.getSimulator() == simulator;
|
||||
}) != end();
|
||||
}
|
||||
return info.getSimulator() == simulator;
|
||||
}) != end();
|
||||
}
|
||||
|
||||
QStringList CSimulatorPluginInfoList::toStringList(bool i18n) const
|
||||
{
|
||||
return this->transform([i18n](const CSimulatorPluginInfo & info) { return info.toQString(i18n); });
|
||||
}
|
||||
QStringList CSimulatorPluginInfoList::toStringList(bool i18n) const
|
||||
{
|
||||
return this->transform([i18n](const CSimulatorPluginInfo & info) { return info.toQString(i18n); });
|
||||
}
|
||||
|
||||
CSimulatorPluginInfo CSimulatorPluginInfoList::findByIdentifier(const QString &identifier) const
|
||||
{
|
||||
return this->findFirstByOrDefault(&CSimulatorPluginInfo::getIdentifier, identifier);
|
||||
}
|
||||
CSimulatorPluginInfo CSimulatorPluginInfoList::findByIdentifier(const QString &identifier) const
|
||||
{
|
||||
return this->findFirstByOrDefault(&CSimulatorPluginInfo::getIdentifier, identifier);
|
||||
}
|
||||
|
||||
CSimulatorPluginInfo CSimulatorPluginInfoList::findBySimulator(const CSimulatorInfo &simulator) const
|
||||
CSimulatorPluginInfo CSimulatorPluginInfoList::findBySimulator(const CSimulatorInfo &simulator) const
|
||||
{
|
||||
for (const CSimulatorPluginInfo &info : *this)
|
||||
{
|
||||
for (const CSimulatorPluginInfo &info : *this)
|
||||
{
|
||||
if (info.getSimulatorInfo() == simulator) { return info; }
|
||||
}
|
||||
return CSimulatorPluginInfo();
|
||||
if (info.getSimulatorInfo() == simulator) { return info; }
|
||||
}
|
||||
} // namespace
|
||||
return CSimulatorPluginInfo();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user