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

@@ -10,37 +10,34 @@
#include "blackmisc/logmessage.h"
namespace BlackCore
namespace BlackCore::Fsd
{
namespace Fsd
FSDIdentification::FSDIdentification() : MessageBase()
{ }
FSDIdentification::FSDIdentification(const QString &callsign, const QString &receiver, const QString &serverVersion, const QString &initialChallenge)
: MessageBase(callsign, receiver),
m_serverVersion(serverVersion),
m_initialChallenge(initialChallenge)
{ }
QStringList FSDIdentification::toTokens() const
{
FSDIdentification::FSDIdentification() : MessageBase()
{ }
QStringList tokens;
tokens.push_back(m_sender);
tokens.push_back(m_receiver);
tokens.push_back(m_serverVersion);
tokens.push_back(m_initialChallenge);
return tokens;
}
FSDIdentification::FSDIdentification(const QString &callsign, const QString &receiver, const QString &serverVersion, const QString &initialChallenge)
: MessageBase(callsign, receiver),
m_serverVersion(serverVersion),
m_initialChallenge(initialChallenge)
{ }
QStringList FSDIdentification::toTokens() const
FSDIdentification FSDIdentification::fromTokens(const QStringList &tokens)
{
if (tokens.size() < 4)
{
QStringList tokens;
tokens.push_back(m_sender);
tokens.push_back(m_receiver);
tokens.push_back(m_serverVersion);
tokens.push_back(m_initialChallenge);
return tokens;
}
FSDIdentification FSDIdentification::fromTokens(const QStringList &tokens)
{
if (tokens.size() < 4)
{
BlackMisc::CLogMessage(static_cast<FSDIdentification *>(nullptr)).debug(u"Wrong number of arguments.");
return {};
};
return FSDIdentification(tokens[0], tokens[1], tokens[2], tokens[3]);
}
BlackMisc::CLogMessage(static_cast<FSDIdentification *>(nullptr)).debug(u"Wrong number of arguments.");
return {};
};
return FSDIdentification(tokens[0], tokens[1], tokens[2], tokens[3]);
}
}