mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-11 14:45:33 +08:00
Use nested namespaces (C++17 feature)
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user