forked from qt-creator/qt-creator
Clang: Inline CompleteCodeMessage
Change-Id: I7009ab3986cb2c8ff7b5c7a77ff22a35bc5d2b10 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
#include "cmbcompletecodemessage.h"
|
#include "cmbcompletecodemessage.h"
|
||||||
|
|
||||||
#include <QDataStream>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
@@ -34,71 +33,6 @@ namespace ClangBackEnd {
|
|||||||
|
|
||||||
quint64 CompleteCodeMessage::ticketCounter = 0;
|
quint64 CompleteCodeMessage::ticketCounter = 0;
|
||||||
|
|
||||||
CompleteCodeMessage::CompleteCodeMessage(const Utf8String &filePath, quint32 line, quint32 column, const Utf8String &projectPartId)
|
|
||||||
: filePath_(filePath),
|
|
||||||
projectPartId_(projectPartId),
|
|
||||||
ticketNumber_(++ticketCounter),
|
|
||||||
line_(line),
|
|
||||||
column_(column)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
const Utf8String &CompleteCodeMessage::filePath() const
|
|
||||||
{
|
|
||||||
return filePath_;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Utf8String &CompleteCodeMessage::projectPartId() const
|
|
||||||
{
|
|
||||||
return projectPartId_;
|
|
||||||
}
|
|
||||||
|
|
||||||
quint32 CompleteCodeMessage::line() const
|
|
||||||
{
|
|
||||||
return line_;
|
|
||||||
}
|
|
||||||
|
|
||||||
quint32 CompleteCodeMessage::column() const
|
|
||||||
{
|
|
||||||
return column_;
|
|
||||||
}
|
|
||||||
|
|
||||||
quint64 CompleteCodeMessage::ticketNumber() const
|
|
||||||
{
|
|
||||||
return ticketNumber_;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDataStream &operator<<(QDataStream &out, const CompleteCodeMessage &message)
|
|
||||||
{
|
|
||||||
out << message.filePath_;
|
|
||||||
out << message.projectPartId_;
|
|
||||||
out << message.ticketNumber_;
|
|
||||||
out << message.line_;
|
|
||||||
out << message.column_;
|
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDataStream &operator>>(QDataStream &in, CompleteCodeMessage &message)
|
|
||||||
{
|
|
||||||
in >> message.filePath_;
|
|
||||||
in >> message.projectPartId_;
|
|
||||||
in >> message.ticketNumber_;
|
|
||||||
in >> message.line_;
|
|
||||||
in >> message.column_;
|
|
||||||
|
|
||||||
return in;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator==(const CompleteCodeMessage &first, const CompleteCodeMessage &second)
|
|
||||||
{
|
|
||||||
return first.ticketNumber_ == second.ticketNumber_
|
|
||||||
&& first.filePath_ == second.filePath_
|
|
||||||
&& first.projectPartId_ == second.projectPartId_
|
|
||||||
&& first.line_ == second.line_
|
|
||||||
&& first.column_ == second.column_;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDebug operator<<(QDebug debug, const CompleteCodeMessage &message)
|
QDebug operator<<(QDebug debug, const CompleteCodeMessage &message)
|
||||||
{
|
{
|
||||||
debug.nospace() << "CompleteCodeMessage(";
|
debug.nospace() << "CompleteCodeMessage(";
|
||||||
|
@@ -29,47 +29,94 @@
|
|||||||
|
|
||||||
#include <utf8string.h>
|
#include <utf8string.h>
|
||||||
|
|
||||||
|
#include <QDataStream>
|
||||||
|
|
||||||
namespace ClangBackEnd {
|
namespace ClangBackEnd {
|
||||||
|
|
||||||
class CMBIPC_EXPORT CompleteCodeMessage
|
class CompleteCodeMessage
|
||||||
{
|
{
|
||||||
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 QDebug operator<<(QDebug debug, const CompleteCodeMessage &message);
|
|
||||||
friend void PrintTo(const CompleteCodeMessage &message, ::std::ostream* os);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CompleteCodeMessage() = default;
|
CompleteCodeMessage() = default;
|
||||||
CompleteCodeMessage(const Utf8String &filePath,
|
CompleteCodeMessage(const Utf8String &filePath,
|
||||||
quint32 line,
|
quint32 line,
|
||||||
quint32 column,
|
quint32 column,
|
||||||
const Utf8String &projectPartId);
|
const Utf8String &projectPartId)
|
||||||
|
: filePath_(filePath),
|
||||||
|
projectPartId_(projectPartId),
|
||||||
|
ticketNumber_(++ticketCounter),
|
||||||
|
line_(line),
|
||||||
|
column_(column)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
const Utf8String &filePath() const;
|
const Utf8String &filePath() const
|
||||||
const Utf8String &projectPartId() const;
|
{
|
||||||
|
return filePath_;
|
||||||
|
}
|
||||||
|
|
||||||
quint32 line() const;
|
const Utf8String &projectPartId() const
|
||||||
quint32 column() const;
|
{
|
||||||
|
return projectPartId_;
|
||||||
|
}
|
||||||
|
|
||||||
quint64 ticketNumber() const;
|
quint32 line() const
|
||||||
|
{
|
||||||
|
return line_;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 column() const
|
||||||
|
{
|
||||||
|
return column_;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint64 ticketNumber() const
|
||||||
|
{
|
||||||
|
return ticketNumber_;
|
||||||
|
}
|
||||||
|
|
||||||
|
friend QDataStream &operator<<(QDataStream &out, const CompleteCodeMessage &message)
|
||||||
|
{
|
||||||
|
out << message.filePath_;
|
||||||
|
out << message.projectPartId_;
|
||||||
|
out << message.ticketNumber_;
|
||||||
|
out << message.line_;
|
||||||
|
out << message.column_;
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
friend QDataStream &operator>>(QDataStream &in, CompleteCodeMessage &message)
|
||||||
|
{
|
||||||
|
in >> message.filePath_;
|
||||||
|
in >> message.projectPartId_;
|
||||||
|
in >> message.ticketNumber_;
|
||||||
|
in >> message.line_;
|
||||||
|
in >> message.column_;
|
||||||
|
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
friend bool operator==(const CompleteCodeMessage &first, const CompleteCodeMessage &second)
|
||||||
|
{
|
||||||
|
return first.ticketNumber_ == second.ticketNumber_
|
||||||
|
&& first.filePath_ == second.filePath_
|
||||||
|
&& first.projectPartId_ == second.projectPartId_
|
||||||
|
&& first.line_ == second.line_
|
||||||
|
&& first.column_ == second.column_;
|
||||||
|
}
|
||||||
|
|
||||||
|
friend CMBIPC_EXPORT QDebug operator<<(QDebug debug, const CompleteCodeMessage &message);
|
||||||
|
friend void PrintTo(const CompleteCodeMessage &message, ::std::ostream* os);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Utf8String filePath_;
|
Utf8String filePath_;
|
||||||
Utf8String projectPartId_;
|
Utf8String projectPartId_;
|
||||||
static quint64 ticketCounter;
|
static CMBIPC_EXPORT quint64 ticketCounter;
|
||||||
quint64 ticketNumber_;
|
quint64 ticketNumber_;
|
||||||
quint32 line_ = 0;
|
quint32 line_ = 0;
|
||||||
quint32 column_ = 0;
|
quint32 column_ = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
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 QDebug operator<<(QDebug debug, const CompleteCodeMessage &message);
|
|
||||||
void PrintTo(const CompleteCodeMessage &message, ::std::ostream* os);
|
|
||||||
|
|
||||||
DECLARE_MESSAGE(CompleteCodeMessage);
|
DECLARE_MESSAGE(CompleteCodeMessage);
|
||||||
|
|
||||||
} // namespace ClangBackEnd
|
} // namespace ClangBackEnd
|
||||||
|
Reference in New Issue
Block a user