swift
Loading...
Searching...
No Matches
rehost.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 "rehost.h"
5
6#include "serializer.h"
7
8#include "misc/logmessage.h"
9
10using namespace swift::misc;
11using namespace swift::misc::aviation;
12
13namespace swift::core::fsd
14{
15 Rehost::Rehost(const QString &sender, const QString &hostname) : MessageBase(sender, {}), m_hostname(hostname) {}
16
18
20 {
21 if (tokens.size() < 2)
22 {
23 CLogMessage(static_cast<Rehost *>(nullptr)).debug(u"Wrong number of arguments.");
24 return {};
25 }
26
27 return { tokens[0], tokens[1] };
28 }
29} // namespace swift::core::fsd
MessageBase()=default
Default Constructor.
QString m_sender
message sender
Definition messagebase.h:85
QString m_hostname
Properties.
Definition rehost.h:32
Rehost(const QString &sender, const QString &hostname)
Constructor.
Definition rehost.cpp:15
QStringList toTokens() const
Message converted to tokens.
Definition rehost.cpp:17
static Rehost fromTokens(const QStringList &tokens)
Construct from tokens.
Definition rehost.cpp:19
Class for emitting a log message.
Definition logmessage.h:27
Derived & debug()
Set the severity to debug.
Free functions in swift::misc.
qsizetype size() const const