mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-22 13:15:39 +08:00
Use nested namespaces (C++17 feature)
This commit is contained in:
@@ -11,48 +11,45 @@
|
||||
#ifndef BLACKCORE_FSD_AUTHCHALLENGE_H
|
||||
#define BLACKCORE_FSD_AUTHCHALLENGE_H
|
||||
|
||||
#include "messagebase.h"
|
||||
#include "blackcore/fsd/messagebase.h"
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackCore::Fsd
|
||||
{
|
||||
namespace Fsd
|
||||
//! FSD Message: auth challenge
|
||||
class BLACKCORE_EXPORT AuthChallenge : public MessageBase
|
||||
{
|
||||
//! FSD Message: auth challenge
|
||||
class BLACKCORE_EXPORT AuthChallenge : public MessageBase
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
AuthChallenge(const QString &sender, const QString &target, const QString &challengeKey);
|
||||
public:
|
||||
//! Constructor
|
||||
AuthChallenge(const QString &sender, const QString &target, const QString &challengeKey);
|
||||
|
||||
//! Message converted to tokens
|
||||
QStringList toTokens() const;
|
||||
//! Message converted to tokens
|
||||
QStringList toTokens() const;
|
||||
|
||||
//! Construct from tokens
|
||||
static AuthChallenge fromTokens(const QStringList &tokens);
|
||||
//! Construct from tokens
|
||||
static AuthChallenge fromTokens(const QStringList &tokens);
|
||||
|
||||
//! PDU identifier
|
||||
static QString pdu() { return QStringLiteral("$ZC"); }
|
||||
//! PDU identifier
|
||||
static QString pdu() { return QStringLiteral("$ZC"); }
|
||||
|
||||
QString m_challengeKey; //!< key
|
||||
QString m_challengeKey; //!< key
|
||||
|
||||
private:
|
||||
//! Ctor
|
||||
AuthChallenge();
|
||||
};
|
||||
private:
|
||||
//! Ctor
|
||||
AuthChallenge();
|
||||
};
|
||||
|
||||
//! Equal to operator
|
||||
inline bool operator==(const AuthChallenge &lhs, const AuthChallenge &rhs)
|
||||
{
|
||||
return lhs.sender() == rhs.sender() &&
|
||||
lhs.receiver() == rhs.receiver() &&
|
||||
lhs.m_challengeKey == rhs.m_challengeKey;
|
||||
}
|
||||
//! Equal to operator
|
||||
inline bool operator==(const AuthChallenge &lhs, const AuthChallenge &rhs)
|
||||
{
|
||||
return lhs.sender() == rhs.sender() &&
|
||||
lhs.receiver() == rhs.receiver() &&
|
||||
lhs.m_challengeKey == rhs.m_challengeKey;
|
||||
}
|
||||
|
||||
//! Not equal to operator
|
||||
inline bool operator!=(const AuthChallenge &lhs, const AuthChallenge &rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
//! Not equal to operator
|
||||
inline bool operator!=(const AuthChallenge &lhs, const AuthChallenge &rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user