Use nested namespaces (C++17 feature)

This commit is contained in:
Mat Sutcliffe
2021-09-15 21:44:54 +01:00
parent 3f2e5b0b69
commit 57d32da826
1345 changed files with 146075 additions and 150376 deletions

View File

@@ -11,38 +11,35 @@
using namespace BlackMisc;
namespace BlackCore
namespace BlackCore::Fsd
{
namespace Fsd
DeletePilot::DeletePilot() : MessageBase()
{ }
DeletePilot::DeletePilot(const QString &callsign, const QString &id)
: MessageBase(callsign),
m_cid(id)
{ }
QStringList DeletePilot::toTokens() const
{
DeletePilot::DeletePilot() : MessageBase()
{ }
auto tokens = QStringList {};
tokens.push_back(m_sender);
tokens.push_back(m_cid);
return tokens;
}
DeletePilot::DeletePilot(const QString &callsign, const QString &id)
: MessageBase(callsign),
m_cid(id)
{ }
QStringList DeletePilot::toTokens() const
DeletePilot DeletePilot::fromTokens(const QStringList &tokens)
{
if (tokens.isEmpty())
{
auto tokens = QStringList {};
tokens.push_back(m_sender);
tokens.push_back(m_cid);
return tokens;
CLogMessage(static_cast<DeletePilot *>(nullptr)).debug(u"Wrong number of arguments.");
return {};
}
DeletePilot DeletePilot::fromTokens(const QStringList &tokens)
{
if (tokens.isEmpty())
{
CLogMessage(static_cast<DeletePilot *>(nullptr)).debug(u"Wrong number of arguments.");
return {};
}
// VATSIM FSD will always supply the CERTIFICATE ID when it rebroadcasts this PDU without regard for whether
// the client originally specified it. But other FSDs might not.
DeletePilot packet(tokens[0], (tokens.size() >= 2) ? tokens[1] : "");
return packet;
}
// VATSIM FSD will always supply the CERTIFICATE ID when it rebroadcasts this PDU without regard for whether
// the client originally specified it. But other FSDs might not.
DeletePilot packet(tokens[0], (tokens.size() >= 2) ? tokens[1] : "");
return packet;
}
}