swift
Loading...
Searching...
No Matches
src
core
fsd
fsdidentification.cpp
1
// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
4
#include "
core/fsd/fsdidentification.h
"
5
6
#include "
misc/logmessage.h
"
7
8
namespace
swift::core::fsd
9
{
10
FSDIdentification::FSDIdentification
(
const
QString
&callsign,
const
QString
&receiver,
const
QString
&serverVersion,
11
const
QString
&initialChallenge)
12
:
MessageBase
(callsign, receiver),
m_serverVersion
(serverVersion),
m_initialChallenge
(initialChallenge)
13
{}
14
15
QStringList
FSDIdentification::toTokens
()
const
16
{
17
QStringList
tokens;
18
tokens.
push_back
(
m_sender
);
19
tokens.
push_back
(
m_receiver
);
20
tokens.
push_back
(
m_serverVersion
);
21
tokens.
push_back
(
m_initialChallenge
);
22
return
tokens;
23
}
24
25
FSDIdentification
FSDIdentification::fromTokens
(
const
QStringList
&tokens)
26
{
27
if
(tokens.
size
() < 4)
28
{
29
swift::misc::CLogMessage
(
static_cast<
FSDIdentification
*
>
(
nullptr
)).
debug
(u
"Wrong number of arguments."
);
30
return
{};
31
};
32
return
{ tokens[0], tokens[1], tokens[2], tokens[3] };
33
}
34
}
// namespace swift::core::fsd
swift::core::fsd::FSDIdentification::m_initialChallenge
QString m_initialChallenge
Properties.
Definition
fsdidentification.h:33
swift::core::fsd::FSDIdentification::m_serverVersion
QString m_serverVersion
Properties.
Definition
fsdidentification.h:32
swift::core::fsd::FSDIdentification::fromTokens
static FSDIdentification fromTokens(const QStringList &tokens)
Construct from tokens.
Definition
fsdidentification.cpp:25
swift::core::fsd::FSDIdentification::FSDIdentification
FSDIdentification(const QString &callsign, const QString &receiver, const QString &serverVersion, const QString &initialChallenge)
Constructor.
Definition
fsdidentification.cpp:10
swift::core::fsd::FSDIdentification::toTokens
QStringList toTokens() const
Message converted to tokens.
Definition
fsdidentification.cpp:15
swift::core::fsd::MessageBase::m_receiver
QString m_receiver
message receiver
Definition
messagebase.h:86
swift::core::fsd::MessageBase::MessageBase
MessageBase()=default
Default Constructor.
swift::core::fsd::MessageBase::m_sender
QString m_sender
message sender
Definition
messagebase.h:85
swift::misc::CLogMessage
Class for emitting a log message.
Definition
logmessage.h:27
swift::misc::CMessageBase::debug
Derived & debug()
Set the severity to debug.
Definition
statusmessage.h:203
fsdidentification.h
logmessage.h
QList::push_back
void push_back(QList< T >::parameter_type value)
QList::size
qsizetype size() const const
QString
QStringList
Generated on
for swift by
1.15.0