mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +08:00
Use nested namespaces (C++17 feature)
This commit is contained in:
@@ -10,35 +10,32 @@
|
||||
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackCore::Fsd
|
||||
{
|
||||
namespace Fsd
|
||||
Pong::Pong() : MessageBase()
|
||||
{ }
|
||||
|
||||
Pong::Pong(const QString &sender, const QString &receiver, const QString ×tamp)
|
||||
: MessageBase(sender, receiver),
|
||||
m_timestamp(timestamp)
|
||||
{ }
|
||||
|
||||
QStringList Pong::toTokens() const
|
||||
{
|
||||
Pong::Pong() : MessageBase()
|
||||
{ }
|
||||
QStringList tokens;
|
||||
tokens.push_back(m_sender);
|
||||
tokens.push_back(m_receiver);
|
||||
tokens.push_back(m_timestamp);
|
||||
return tokens;
|
||||
}
|
||||
|
||||
Pong::Pong(const QString &sender, const QString &receiver, const QString ×tamp)
|
||||
: MessageBase(sender, receiver),
|
||||
m_timestamp(timestamp)
|
||||
{ }
|
||||
|
||||
QStringList Pong::toTokens() const
|
||||
Pong Pong::fromTokens(const QStringList &tokens)
|
||||
{
|
||||
if (tokens.size() < 3)
|
||||
{
|
||||
QStringList tokens;
|
||||
tokens.push_back(m_sender);
|
||||
tokens.push_back(m_receiver);
|
||||
tokens.push_back(m_timestamp);
|
||||
return tokens;
|
||||
}
|
||||
|
||||
Pong Pong::fromTokens(const QStringList &tokens)
|
||||
{
|
||||
if (tokens.size() < 3)
|
||||
{
|
||||
BlackMisc::CLogMessage(static_cast<Pong *>(nullptr)).debug(u"Wrong number of arguments.");
|
||||
return {};
|
||||
};
|
||||
return Pong(tokens[0], tokens[1], tokens[2]);
|
||||
}
|
||||
BlackMisc::CLogMessage(static_cast<Pong *>(nullptr)).debug(u"Wrong number of arguments.");
|
||||
return {};
|
||||
};
|
||||
return Pong(tokens[0], tokens[1], tokens[2]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user