Commit ec4d0028 authored by Marco Bubke's avatar Marco Bubke

Clang: Rename command in message

Change-Id: I1e2671d15b0db3c670b86dd0d4bed5ee09e866f1
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent 66df65b2
......@@ -13,29 +13,29 @@ INCLUDEPATH += $$PWD
SOURCES += $$PWD/ipcserverinterface.cpp \
$$PWD/ipcserverproxy.cpp \
$$PWD/ipcclientinterface.cpp \
$$PWD/cmbendcommand.cpp \
$$PWD/cmbalivecommand.cpp \
$$PWD/cmbendmessage.cpp \
$$PWD/cmbalivemessage.cpp \
$$PWD/ipcclientproxy.cpp \
$$PWD/cmbcommands.cpp \
$$PWD/writecommandblock.cpp \
$$PWD/readcommandblock.cpp \
$$PWD/cmbmessages.cpp \
$$PWD/writemessageblock.cpp \
$$PWD/readmessageblock.cpp \
$$PWD/ipcinterface.cpp \
$$PWD/connectionserver.cpp \
$$PWD/connectionclient.cpp \
$$PWD/cmbechocommand.cpp \
$$PWD/cmbechomessage.cpp \
$$PWD/ipcclientdispatcher.cpp \
$$PWD/cmbregistertranslationunitsforcodecompletioncommand.cpp \
$$PWD/cmbregistertranslationunitsforcodecompletionmessage.cpp \
$$PWD/filecontainer.cpp \
$$PWD/cmbunregistertranslationunitsforcodecompletioncommand.cpp \
$$PWD/cmbcompletecodecommand.cpp \
$$PWD/cmbcodecompletedcommand.cpp \
$$PWD/cmbunregistertranslationunitsforcodecompletionmessage.cpp \
$$PWD/cmbcompletecodemessage.cpp \
$$PWD/cmbcodecompletedmessage.cpp \
$$PWD/codecompletion.cpp \
$$PWD/cmbregisterprojectsforcodecompletioncommand.cpp \
$$PWD/cmbunregisterprojectsforcodecompletioncommand.cpp \
$$PWD/translationunitdoesnotexistcommand.cpp \
$$PWD/cmbregisterprojectsforcodecompletionmessage.cpp \
$$PWD/cmbunregisterprojectsforcodecompletionmessage.cpp \
$$PWD/translationunitdoesnotexistmessage.cpp \
$$PWD/codecompletionchunk.cpp \
$$PWD/projectpartcontainer.cpp \
$$PWD/projectpartsdonotexistcommand.cpp \
$$PWD/projectpartsdonotexistmessage.cpp \
$$PWD/lineprefixer.cpp \
$$PWD/clangbackendipcdebugutils.cpp
......@@ -43,29 +43,29 @@ HEADERS += \
$$PWD/ipcserverinterface.h \
$$PWD/ipcserverproxy.h \
$$PWD/ipcclientinterface.h \
$$PWD/cmbendcommand.h \
$$PWD/cmbalivecommand.h \
$$PWD/cmbendmessage.h \
$$PWD/cmbalivemessage.h \
$$PWD/ipcclientproxy.h \
$$PWD/cmbcommands.h \
$$PWD/writecommandblock.h \
$$PWD/readcommandblock.h \
$$PWD/cmbmessages.h \
$$PWD/writemessageblock.h \
$$PWD/readmessageblock.h \
$$PWD/ipcinterface.h \
$$PWD/connectionserver.h \
$$PWD/connectionclient.h \
$$PWD/cmbechocommand.h \
$$PWD/cmbechomessage.h \
$$PWD/ipcclientdispatcher.h \
$$PWD/cmbregistertranslationunitsforcodecompletioncommand.h \
$$PWD/cmbregistertranslationunitsforcodecompletionmessage.h \
$$PWD/filecontainer.h \
$$PWD/cmbunregistertranslationunitsforcodecompletioncommand.h \
$$PWD/cmbcompletecodecommand.h \
$$PWD/cmbcodecompletedcommand.h \
$$PWD/cmbunregistertranslationunitsforcodecompletionmessage.h \
$$PWD/cmbcompletecodemessage.h \
$$PWD/cmbcodecompletedmessage.h \
$$PWD/codecompletion.h \
$$PWD/cmbregisterprojectsforcodecompletioncommand.h \
$$PWD/cmbunregisterprojectsforcodecompletioncommand.h \
$$PWD/translationunitdoesnotexistcommand.h \
$$PWD/cmbregisterprojectsforcodecompletionmessage.h \
$$PWD/cmbunregisterprojectsforcodecompletionmessage.h \
$$PWD/translationunitdoesnotexistmessage.h \
$$PWD/codecompletionchunk.h \
$$PWD/projectpartcontainer.h \
$$PWD/projectpartsdonotexistcommand.h \
$$PWD/projectpartsdonotexistmessage.h \
$$PWD/container_common.h \
$$PWD/clangbackendipc_global.h \
$$PWD/lineprefixer.h \
......
......@@ -28,36 +28,36 @@
**
****************************************************************************/
#include "cmbalivecommand.h"
#include "cmbalivemessage.h"
#include <QDataStream>
#include <QDebug>
namespace ClangBackEnd {
QDataStream &operator<<(QDataStream &out, const AliveCommand &/*command*/)
QDataStream &operator<<(QDataStream &out, const AliveMessage &/*message*/)
{
return out;
}
QDataStream &operator>>(QDataStream &in, AliveCommand &/*command*/)
QDataStream &operator>>(QDataStream &in, AliveMessage &/*message*/)
{
return in;
}
bool operator==(const AliveCommand &/*first*/, const AliveCommand &/*second*/)
bool operator==(const AliveMessage &/*first*/, const AliveMessage &/*second*/)
{
return true;
}
bool operator<(const AliveCommand &/*first*/, const AliveCommand &/*second*/)
bool operator<(const AliveMessage &/*first*/, const AliveMessage &/*second*/)
{
return true;
}
QDebug operator<<(QDebug debug, const AliveCommand &/*command*/)
QDebug operator<<(QDebug debug, const AliveMessage &/*message*/)
{
return debug.nospace() << "AliveCommand()";
return debug.nospace() << "AliveMessage()";
}
}
......@@ -28,8 +28,8 @@
**
****************************************************************************/
#ifndef CMBALIVECOMMAND_H
#define CMBALIVECOMMAND_H
#ifndef CMBALIVEMESSAGE_H
#define CMBALIVEMESSAGE_H
#include "clangbackendipc_global.h"
......@@ -37,19 +37,19 @@
namespace ClangBackEnd {
class CMBIPC_EXPORT AliveCommand
class CMBIPC_EXPORT AliveMessage
{
};
CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const AliveCommand &command);
CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, AliveCommand &command);
CMBIPC_EXPORT bool operator==(const AliveCommand &first, const AliveCommand &second);
CMBIPC_EXPORT bool operator<(const AliveCommand &first, const AliveCommand &second);
CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const AliveMessage &message);
CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, AliveMessage &message);
CMBIPC_EXPORT bool operator==(const AliveMessage &first, const AliveMessage &second);
CMBIPC_EXPORT bool operator<(const AliveMessage &first, const AliveMessage &second);
CMBIPC_EXPORT QDebug operator<<(QDebug debug, const AliveCommand &command);
CMBIPC_EXPORT QDebug operator<<(QDebug debug, const AliveMessage &message);
}
Q_DECLARE_METATYPE(ClangBackEnd::AliveCommand)
Q_DECLARE_METATYPE(ClangBackEnd::AliveMessage)
#endif // CMBALIVECOMMAND_H
#endif // CMBALIVEMESSAGE_H
......@@ -28,7 +28,7 @@
**
****************************************************************************/
#include "cmbcodecompletedcommand.h"
#include "cmbcodecompletedmessage.h"
#include <QDataStream>
#include <QDebug>
......@@ -37,66 +37,66 @@
namespace ClangBackEnd {
CodeCompletedCommand::CodeCompletedCommand(const CodeCompletions &codeCompletions, quint64 ticketNumber)
CodeCompletedMessage::CodeCompletedMessage(const CodeCompletions &codeCompletions, quint64 ticketNumber)
: codeCompletions_(codeCompletions),
ticketNumber_(ticketNumber)
{
}
const CodeCompletions &CodeCompletedCommand::codeCompletions() const
const CodeCompletions &CodeCompletedMessage::codeCompletions() const
{
return codeCompletions_;
}
quint64 CodeCompletedCommand::ticketNumber() const
quint64 CodeCompletedMessage::ticketNumber() const
{
return ticketNumber_;
}
QDataStream &operator<<(QDataStream &out, const CodeCompletedCommand &command)
QDataStream &operator<<(QDataStream &out, const CodeCompletedMessage &message)
{
out << command.codeCompletions_;
out << command.ticketNumber_;
out << message.codeCompletions_;
out << message.ticketNumber_;
return out;
}
QDataStream &operator>>(QDataStream &in, CodeCompletedCommand &command)
QDataStream &operator>>(QDataStream &in, CodeCompletedMessage &message)
{
in >> command.codeCompletions_;
in >> command.ticketNumber_;
in >> message.codeCompletions_;
in >> message.ticketNumber_;
return in;
}
bool operator==(const CodeCompletedCommand &first, const CodeCompletedCommand &second)
bool operator==(const CodeCompletedMessage &first, const CodeCompletedMessage &second)
{
return first.ticketNumber_ == second.ticketNumber_
&& first.codeCompletions_ == second.codeCompletions_;
}
bool operator<(const CodeCompletedCommand &first, const CodeCompletedCommand &second)
bool operator<(const CodeCompletedMessage &first, const CodeCompletedMessage &second)
{
return first.ticketNumber_ < second.ticketNumber_;
}
QDebug operator<<(QDebug debug, const CodeCompletedCommand &command)
QDebug operator<<(QDebug debug, const CodeCompletedMessage &message)
{
debug.nospace() << "CodeCompletedCommand(";
debug.nospace() << "CodeCompletedMessage(";
debug.nospace() << command.codeCompletions_ << ", " << command.ticketNumber_;
debug.nospace() << message.codeCompletions_ << ", " << message.ticketNumber_;
debug.nospace() << ")";
return debug;
}
void PrintTo(const CodeCompletedCommand &command, ::std::ostream* os)
void PrintTo(const CodeCompletedMessage &message, ::std::ostream* os)
{
QString output;
QDebug debug(&output);
debug << command;
debug << message;
*os << output.toUtf8().constData();
}
......
......@@ -28,8 +28,8 @@
**
****************************************************************************/
#ifndef CLANGBACKEND_CODECOMPLETEDCOMMAND_H
#define CLANGBACKEND_CODECOMPLETEDCOMMAND_H
#ifndef CLANGBACKEND_CODECOMPLETEDMESSAGE_H
#define CLANGBACKEND_CODECOMPLETEDMESSAGE_H
#include "codecompletion.h"
......@@ -38,17 +38,17 @@
namespace ClangBackEnd {
class CMBIPC_EXPORT CodeCompletedCommand
class CMBIPC_EXPORT CodeCompletedMessage
{
friend CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const CodeCompletedCommand &command);
friend CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, CodeCompletedCommand &command);
friend CMBIPC_EXPORT bool operator==(const CodeCompletedCommand &first, const CodeCompletedCommand &second);
friend CMBIPC_EXPORT bool operator<(const CodeCompletedCommand &first, const CodeCompletedCommand &second);
friend CMBIPC_EXPORT QDebug operator<<(QDebug debug, const CodeCompletedCommand &command);
friend void PrintTo(const CodeCompletedCommand &command, ::std::ostream* os);
friend CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const CodeCompletedMessage &message);
friend CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, CodeCompletedMessage &message);
friend CMBIPC_EXPORT bool operator==(const CodeCompletedMessage &first, const CodeCompletedMessage &second);
friend CMBIPC_EXPORT bool operator<(const CodeCompletedMessage &first, const CodeCompletedMessage &second);
friend CMBIPC_EXPORT QDebug operator<<(QDebug debug, const CodeCompletedMessage &message);
friend void PrintTo(const CodeCompletedMessage &message, ::std::ostream* os);
public:
CodeCompletedCommand() = default;
CodeCompletedCommand(const CodeCompletions &codeCompletions, quint64 ticketNumber);
CodeCompletedMessage() = default;
CodeCompletedMessage(const CodeCompletions &codeCompletions, quint64 ticketNumber);
const CodeCompletions &codeCompletions() const;
......@@ -59,16 +59,16 @@ private:
quint64 ticketNumber_ = 0;
};
CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const CodeCompletedCommand &command);
CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, CodeCompletedCommand &command);
CMBIPC_EXPORT bool operator==(const CodeCompletedCommand &first, const CodeCompletedCommand &second);
CMBIPC_EXPORT bool operator<(const CodeCompletedCommand &first, const CodeCompletedCommand &second);
CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const CodeCompletedMessage &message);
CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, CodeCompletedMessage &message);
CMBIPC_EXPORT bool operator==(const CodeCompletedMessage &first, const CodeCompletedMessage &second);
CMBIPC_EXPORT bool operator<(const CodeCompletedMessage &first, const CodeCompletedMessage &second);
CMBIPC_EXPORT QDebug operator<<(QDebug debug, const CodeCompletedCommand &command);
void PrintTo(const CodeCompletedCommand &command, ::std::ostream* os);
CMBIPC_EXPORT QDebug operator<<(QDebug debug, const CodeCompletedMessage &message);
void PrintTo(const CodeCompletedMessage &message, ::std::ostream* os);
} // namespace ClangBackEnd
Q_DECLARE_METATYPE(ClangBackEnd::CodeCompletedCommand)
Q_DECLARE_METATYPE(ClangBackEnd::CodeCompletedMessage)
#endif // CLANGBACKEND_CODECOMPLETEDCOMMAND_H
#endif // CLANGBACKEND_CODECOMPLETEDMESSAGE_H
......@@ -28,7 +28,7 @@
**
****************************************************************************/
#include "cmbcompletecodecommand.h"
#include "cmbcompletecodemessage.h"
#include <QDataStream>
#include <QDebug>
......@@ -37,9 +37,9 @@
namespace ClangBackEnd {
quint64 CompleteCodeCommand::ticketCounter = 0;
quint64 CompleteCodeMessage::ticketCounter = 0;
CompleteCodeCommand::CompleteCodeCommand(const Utf8String &filePath, quint32 line, quint32 column, const Utf8String &projectPartId)
CompleteCodeMessage::CompleteCodeMessage(const Utf8String &filePath, quint32 line, quint32 column, const Utf8String &projectPartId)
: filePath_(filePath),
projectPartId_(projectPartId),
ticketNumber_(++ticketCounter),
......@@ -48,54 +48,54 @@ CompleteCodeCommand::CompleteCodeCommand(const Utf8String &filePath, quint32 lin
{
}
const Utf8String &CompleteCodeCommand::filePath() const
const Utf8String &CompleteCodeMessage::filePath() const
{
return filePath_;
}
const Utf8String &CompleteCodeCommand::projectPartId() const
const Utf8String &CompleteCodeMessage::projectPartId() const
{
return projectPartId_;
}
quint32 CompleteCodeCommand::line() const
quint32 CompleteCodeMessage::line() const
{
return line_;
}
quint32 CompleteCodeCommand::column() const
quint32 CompleteCodeMessage::column() const
{
return column_;
}
quint64 CompleteCodeCommand::ticketNumber() const
quint64 CompleteCodeMessage::ticketNumber() const
{
return ticketNumber_;
}
QDataStream &operator<<(QDataStream &out, const CompleteCodeCommand &command)
QDataStream &operator<<(QDataStream &out, const CompleteCodeMessage &message)
{
out << command.filePath_;
out << command.projectPartId_;
out << command.ticketNumber_;
out << command.line_;
out << command.column_;
out << message.filePath_;
out << message.projectPartId_;
out << message.ticketNumber_;
out << message.line_;
out << message.column_;
return out;
}
QDataStream &operator>>(QDataStream &in, CompleteCodeCommand &command)
QDataStream &operator>>(QDataStream &in, CompleteCodeMessage &message)
{
in >> command.filePath_;
in >> command.projectPartId_;
in >> command.ticketNumber_;
in >> command.line_;
in >> command.column_;
in >> message.filePath_;
in >> message.projectPartId_;
in >> message.ticketNumber_;
in >> message.line_;
in >> message.column_;
return in;
}
bool operator==(const CompleteCodeCommand &first, const CompleteCodeCommand &second)
bool operator==(const CompleteCodeMessage &first, const CompleteCodeMessage &second)
{
return first.ticketNumber_ == second.ticketNumber_
&& first.filePath_ == second.filePath_
......@@ -104,7 +104,7 @@ bool operator==(const CompleteCodeCommand &first, const CompleteCodeCommand &sec
&& first.column_ == second.column_;
}
bool operator<(const CompleteCodeCommand &first, const CompleteCodeCommand &second)
bool operator<(const CompleteCodeMessage &first, const CompleteCodeMessage &second)
{
return first.ticketNumber_ < second.ticketNumber_
&& first.filePath_ < second.filePath_
......@@ -113,30 +113,30 @@ bool operator<(const CompleteCodeCommand &first, const CompleteCodeCommand &seco
&& first.column_ < second.column_;
}
QDebug operator<<(QDebug debug, const CompleteCodeCommand &command)
QDebug operator<<(QDebug debug, const CompleteCodeMessage &message)
{
debug.nospace() << "CompleteCodeCommand(";
debug.nospace() << "CompleteCodeMessage(";
debug.nospace() << command.filePath_ << ", ";
debug.nospace() << command.line_<< ", ";
debug.nospace() << command.column_<< ", ";
debug.nospace() << command.projectPartId_ << ", ";
debug.nospace() << command.ticketNumber_;
debug.nospace() << message.filePath_ << ", ";
debug.nospace() << message.line_<< ", ";
debug.nospace() << message.column_<< ", ";
debug.nospace() << message.projectPartId_ << ", ";
debug.nospace() << message.ticketNumber_;
debug.nospace() << ")";
return debug;
}
void PrintTo(const CompleteCodeCommand &command, ::std::ostream* os)
void PrintTo(const CompleteCodeMessage &message, ::std::ostream* os)
{
*os << "CompleteCodeCommand(";
*os << "CompleteCodeMessage(";
*os << command.filePath_.constData() << ", ";
*os << command.line_ << ", ";
*os << command.column_ << ", ";
*os << command.projectPartId_.constData() << ", ";
*os << command.ticketNumber_;
*os << message.filePath_.constData() << ", ";
*os << message.line_ << ", ";
*os << message.column_ << ", ";
*os << message.projectPartId_.constData() << ", ";
*os << message.ticketNumber_;
*os << ")";
}
......
......@@ -28,8 +28,8 @@
**
****************************************************************************/
#ifndef CLANGBACKEND_COMPLETECODECOMMAND_H
#define CLANGBACKEND_COMPLETECODECOMMAND_H
#ifndef CLANGBACKEND_COMPLETECODEMESSAGE_H
#define CLANGBACKEND_COMPLETECODEMESSAGE_H
#include "clangbackendipc_global.h"
......@@ -39,18 +39,18 @@
namespace ClangBackEnd {
class CMBIPC_EXPORT CompleteCodeCommand
class CMBIPC_EXPORT CompleteCodeMessage
{
friend CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const CompleteCodeCommand &command);
friend CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, CompleteCodeCommand &command);
friend CMBIPC_EXPORT bool operator==(const CompleteCodeCommand &first, const CompleteCodeCommand &second);
friend CMBIPC_EXPORT bool operator<(const CompleteCodeCommand &first, const CompleteCodeCommand &second);
friend CMBIPC_EXPORT QDebug operator<<(QDebug debug, const CompleteCodeCommand &command);
friend void PrintTo(const CompleteCodeCommand &command, ::std::ostream* os);
friend CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const CompleteCodeMessage &message);
friend CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, CompleteCodeMessage &message);
friend CMBIPC_EXPORT bool operator==(const CompleteCodeMessage &first, const CompleteCodeMessage &second);
friend CMBIPC_EXPORT bool operator<(const CompleteCodeMessage &first, const CompleteCodeMessage &second);
friend CMBIPC_EXPORT QDebug operator<<(QDebug debug, const CompleteCodeMessage &message);
friend void PrintTo(const CompleteCodeMessage &message, ::std::ostream* os);
public:
CompleteCodeCommand() = default;
CompleteCodeCommand(const Utf8String &filePath,
CompleteCodeMessage() = default;
CompleteCodeMessage(const Utf8String &filePath,
quint32 line,
quint32 column,
const Utf8String &projectPartId);
......@@ -72,16 +72,16 @@ private:
quint32 column_ = 0;
};
CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const CompleteCodeCommand &command);
CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, CompleteCodeCommand &command);
CMBIPC_EXPORT bool operator==(const CompleteCodeCommand &first, const CompleteCodeCommand &second);
CMBIPC_EXPORT bool operator<(const CompleteCodeCommand &first, const CompleteCodeCommand &second);
CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const CompleteCodeMessage &message);
CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, CompleteCodeMessage &message);
CMBIPC_EXPORT bool operator==(const CompleteCodeMessage &first, const CompleteCodeMessage &second);
CMBIPC_EXPORT bool operator<(const CompleteCodeMessage &first, const CompleteCodeMessage &second);
CMBIPC_EXPORT QDebug operator<<(QDebug debug, const CompleteCodeCommand &command);
void PrintTo(const CompleteCodeCommand &command, ::std::ostream* os);
CMBIPC_EXPORT QDebug operator<<(QDebug debug, const CompleteCodeMessage &message);
void PrintTo(const CompleteCodeMessage &message, ::std::ostream* os);
} // namespace ClangBackEnd
Q_DECLARE_METATYPE(ClangBackEnd::CompleteCodeCommand)
Q_DECLARE_METATYPE(ClangBackEnd::CompleteCodeMessage)
#endif // CLANGBACKEND_COMPLETECODECOMMAND_H
#endif // CLANGBACKEND_COMPLETECODEMESSAGE_H
......@@ -28,7 +28,7 @@
**
****************************************************************************/
#include "cmbechocommand.h"
#include "cmbechomessage.h"
#include <QDataStream>
#include <QDebug>
......@@ -37,52 +37,52 @@
namespace ClangBackEnd {
EchoCommand::EchoCommand(const QVariant &command)
: command_(command)
EchoMessage::EchoMessage(const QVariant &message)
: message_(message)
{
}
const QVariant &EchoCommand::command() const
const QVariant &EchoMessage::message() const
{
return command_;
return message_;
}
QDataStream &operator<<(QDataStream &out, const EchoCommand &command)
QDataStream &operator<<(QDataStream &out, const EchoMessage &message)
{
out << command.command();
out << message.message();
return out;
}
QDataStream &operator>>(QDataStream &in, EchoCommand &command)
QDataStream &operator>>(QDataStream &in, EchoMessage &message)
{
in >> command.command_;
in >> message.message_;
return in;
}
bool operator==(const EchoCommand &first, const EchoCommand &second)
bool operator==(const EchoMessage &first, const EchoMessage &second)
{
return first.command_ == second.command_;
return first.message_ == second.message_;
}
bool operator<(const EchoCommand &first, const EchoCommand &second)
bool operator<(const EchoMessage &first, const EchoMessage &second)
{
return first.command_ < second.command_;
return first.message_ < second.message_;
}
QDebug operator<<(QDebug debug, const EchoCommand &command)
QDebug operator<<(QDebug debug, const EchoMessage &message)
{
return debug.nospace() << "EchoCommand(" << command.command() << ")";
return debug.nospace() << "EchoMessage(" << message.message() << ")";
}
void PrintTo(const EchoCommand &command, ::std::ostream* os)
void PrintTo(const EchoMessage &message, ::std::ostream* os)
{
QString output;
QDebug debug(&output);
debug << command;
debug << message;
*os << output.toUtf8().constData();
}
......
......@@ -28,8 +28,8 @@
**
****************************************************************************/
#ifndef CLANGBACKEND_ECHOCOMMAND_H
#define CLANGBACKEND_ECHOCOMMAND_H
#ifndef CLANGBACKEND_ECHOMESSAGE_H
#define CLANGBACKEND_ECHOMESSAGE_H
#include "clangbackendipc_global.h"
......@@ -38,31 +38,31 @@
namespace ClangBackEnd {
class CMBIPC_EXPORT EchoCommand
class CMBIPC_EXPORT EchoMessage
{
friend CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, EchoCommand &command);
friend CMBIPC_EXPORT bool operator==(const EchoCommand &first, const EchoCommand &second);
friend CMBIPC_EXPORT bool operator<(const EchoCommand &first, const EchoCommand &second);
friend CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, EchoMessage &message);
friend CMBIPC_EXPORT bool operator==(const EchoMessage &first, const EchoMessage &second);
friend CMBIPC_EXPORT bool operator<(const EchoMessage &first, const EchoMessage &second);
public:
EchoCommand() = default;
explicit EchoCommand(const QVariant &command);
EchoMessage() = default;
explicit EchoMessage(const QVariant &message);
const QVariant &command() const;