From 855bf6b007f03a88807e938f1c95d6bcb5e897a7 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 19 Jul 2016 12:38:18 +0200 Subject: [PATCH] Clang: Inline TranslationUnitDoesNotExistMessage Change-Id: Ib1f23410163036eb8de603eb3eef82c14428a8a5 Reviewed-by: Tim Jenssen --- .../translationunitdoesnotexistmessage.cpp | 47 +-------------- .../translationunitdoesnotexistmessage.h | 58 ++++++++++++++----- 2 files changed, 44 insertions(+), 61 deletions(-) diff --git a/src/libs/clangbackendipc/translationunitdoesnotexistmessage.cpp b/src/libs/clangbackendipc/translationunitdoesnotexistmessage.cpp index 6146e27b819..22b104a9460 100644 --- a/src/libs/clangbackendipc/translationunitdoesnotexistmessage.cpp +++ b/src/libs/clangbackendipc/translationunitdoesnotexistmessage.cpp @@ -25,62 +25,17 @@ #include "translationunitdoesnotexistmessage.h" -#include #include #include namespace ClangBackEnd { -TranslationUnitDoesNotExistMessage::TranslationUnitDoesNotExistMessage(const FileContainer &fileContainer) - : fileContainer_(fileContainer) -{ -} - -TranslationUnitDoesNotExistMessage::TranslationUnitDoesNotExistMessage(const Utf8String &filePath, const Utf8String &projectPartId) - : fileContainer_(filePath, projectPartId) -{ -} - -const FileContainer &TranslationUnitDoesNotExistMessage::fileContainer() const -{ - return fileContainer_; -} - -const Utf8String &TranslationUnitDoesNotExistMessage::filePath() const -{ - return fileContainer_.filePath(); -} - -const Utf8String &TranslationUnitDoesNotExistMessage::projectPartId() const -{ - return fileContainer_.projectPartId(); -} - -QDataStream &operator<<(QDataStream &out, const TranslationUnitDoesNotExistMessage &message) -{ - out << message.fileContainer_; - - return out; -} - -QDataStream &operator>>(QDataStream &in, TranslationUnitDoesNotExistMessage &message) -{ - in >> message.fileContainer_; - - return in; -} - -bool operator==(const TranslationUnitDoesNotExistMessage &first, const TranslationUnitDoesNotExistMessage &second) -{ - return first.fileContainer_ == second.fileContainer_; -} - QDebug operator<<(QDebug debug, const TranslationUnitDoesNotExistMessage &message) { debug.nospace() << "TranslationUnitDoesNotExistMessage("; - debug.nospace() << message.fileContainer_; + debug.nospace() << message.fileContainer(); debug.nospace() << ")"; diff --git a/src/libs/clangbackendipc/translationunitdoesnotexistmessage.h b/src/libs/clangbackendipc/translationunitdoesnotexistmessage.h index e4b7a547ab9..1cecbbe78d2 100644 --- a/src/libs/clangbackendipc/translationunitdoesnotexistmessage.h +++ b/src/libs/clangbackendipc/translationunitdoesnotexistmessage.h @@ -29,30 +29,58 @@ namespace ClangBackEnd { -class CMBIPC_EXPORT TranslationUnitDoesNotExistMessage +class TranslationUnitDoesNotExistMessage { - friend CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const TranslationUnitDoesNotExistMessage &message); - friend CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, TranslationUnitDoesNotExistMessage &message); - friend CMBIPC_EXPORT bool operator==(const TranslationUnitDoesNotExistMessage &first, const TranslationUnitDoesNotExistMessage &second); - friend CMBIPC_EXPORT QDebug operator<<(QDebug debug, const TranslationUnitDoesNotExistMessage &message); - friend void PrintTo(const TranslationUnitDoesNotExistMessage &message, ::std::ostream* os); public: TranslationUnitDoesNotExistMessage() = default; - TranslationUnitDoesNotExistMessage(const FileContainer &fileContainer); - TranslationUnitDoesNotExistMessage(const Utf8String &filePath, const Utf8String &projectPartId); + TranslationUnitDoesNotExistMessage(const FileContainer &fileContainer) + : fileContainer_(fileContainer) + { + } - const FileContainer &fileContainer() const; - const Utf8String &filePath() const; - const Utf8String &projectPartId() const; + TranslationUnitDoesNotExistMessage(const Utf8String &filePath, const Utf8String &projectPartId) + : fileContainer_(filePath, projectPartId) + { + } + + const FileContainer &fileContainer() const + { + return fileContainer_; + } + + const Utf8String &filePath() const + { + return fileContainer_.filePath(); + } + + const Utf8String &projectPartId() const + { + return fileContainer_.projectPartId(); + } + + friend QDataStream &operator<<(QDataStream &out, const TranslationUnitDoesNotExistMessage &message) + { + out << message.fileContainer_; + + return out; + } + + friend QDataStream &operator>>(QDataStream &in, TranslationUnitDoesNotExistMessage &message) + { + in >> message.fileContainer_; + + return in; + } + + friend bool operator==(const TranslationUnitDoesNotExistMessage &first, const TranslationUnitDoesNotExistMessage &second) + { + return first.fileContainer_ == second.fileContainer_; + } private: FileContainer fileContainer_; }; -CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const TranslationUnitDoesNotExistMessage &message); -CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, TranslationUnitDoesNotExistMessage &message); -CMBIPC_EXPORT bool operator==(const TranslationUnitDoesNotExistMessage &first, const TranslationUnitDoesNotExistMessage &second); - CMBIPC_EXPORT QDebug operator<<(QDebug debug, const TranslationUnitDoesNotExistMessage &message); void PrintTo(const TranslationUnitDoesNotExistMessage &message, ::std::ostream* os);