aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@digia.com>2012-11-27 21:23:45 +0100
committerChristian Kandeler <christian.kandeler@digia.com>2012-11-28 16:00:11 +0100
commitc412e0382db1bd4e98ec1797b69351198065b57c (patch)
treef068cd30b7621763e90d9f6ab4f0c13d5064d7df
parentb15ec049984dbe03e16620d9cdbcfb4e3448e58c (diff)
Add comparison operators to projectdata
Change-Id: I8eaa24edef7d5c4d21f07039e3cf8a58c1d4579d Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
-rw-r--r--src/lib/api/projectdata.cpp42
-rw-r--r--src/lib/api/projectdata.h7
2 files changed, 49 insertions, 0 deletions
diff --git a/src/lib/api/projectdata.cpp b/src/lib/api/projectdata.cpp
index c11154f31..830c5a5a7 100644
--- a/src/lib/api/projectdata.cpp
+++ b/src/lib/api/projectdata.cpp
@@ -32,9 +32,51 @@ namespace qbs {
// These are not inline because MSVC does not like it when source files have no content.
GroupData::GroupData() { }
+
+bool operator==(const GroupData &lhs, const GroupData &rhs)
+{
+ return lhs.name() == rhs.name()
+ && lhs.qbsLine() == rhs.qbsLine()
+ && lhs.filePaths() == rhs.filePaths()
+ && lhs.expandedWildcards() == rhs.expandedWildcards()
+ && lhs.properties() == rhs.properties();
+}
+
+bool operator!=(const GroupData &lhs, const GroupData &rhs)
+{
+ return !(lhs == rhs);
+}
+
ProductData::ProductData() { }
+
+bool operator==(const ProductData &lhs, const ProductData &rhs)
+{
+ return lhs.name() == rhs.name()
+ && lhs.qbsFilePath() == rhs.qbsFilePath()
+ && lhs.qbsLine() == rhs.qbsLine()
+ && lhs.fileTags() == rhs.fileTags()
+ && lhs.properties() == rhs.properties()
+ && lhs.groups() == rhs.groups();
+}
+
+bool operator!=(const ProductData &lhs, const ProductData &rhs)
+{
+ return !(lhs == rhs);
+}
+
ProjectData::ProjectData() { }
+bool operator==(const ProjectData &lhs, const ProjectData &rhs)
+{
+ return lhs.qbsFilePath() == rhs.qbsFilePath()
+ && lhs.products() == rhs.products();
+}
+
+bool operator!=(const ProjectData &lhs, const ProjectData &rhs)
+{
+ return !(lhs == rhs);
+}
+
/*!
* \class GroupData
* \brief The \c GroupData class corresponds to the Group item in a qbs source file.
diff --git a/src/lib/api/projectdata.h b/src/lib/api/projectdata.h
index 2775761f5..737aaf3c6 100644
--- a/src/lib/api/projectdata.h
+++ b/src/lib/api/projectdata.h
@@ -63,6 +63,8 @@ private:
QVariantMap m_properties;
};
+bool operator==(const GroupData &lhs, const GroupData &rhs);
+bool operator!=(const GroupData &lhs, const GroupData &rhs);
class ProductData
{
@@ -86,6 +88,8 @@ private:
QList<GroupData> m_groups;
};
+bool operator==(const ProductData &lhs, const ProductData &rhs);
+bool operator!=(const ProductData &lhs, const ProductData &rhs);
class ProjectData
{
@@ -101,6 +105,9 @@ private:
QList<ProductData> m_products;
};
+bool operator==(const ProjectData &lhs, const ProjectData &rhs);
+bool operator!=(const ProjectData &lhs, const ProjectData &rhs);
+
} // namespace qbs
#endif // PUBLICTYPES_H