aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/include.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/ApiExtractor/include.h')
-rw-r--r--sources/shiboken6/ApiExtractor/include.h43
1 files changed, 33 insertions, 10 deletions
diff --git a/sources/shiboken6/ApiExtractor/include.h b/sources/shiboken6/ApiExtractor/include.h
index fcbaf9b9c..7fd7d3b36 100644
--- a/sources/shiboken6/ApiExtractor/include.h
+++ b/sources/shiboken6/ApiExtractor/include.h
@@ -42,23 +42,46 @@ public:
QString toString() const;
- bool operator<(const Include& other) const
- {
- return m_name < other.m_name;
- }
-
- bool operator==(const Include& other) const
- {
- return m_type == other.m_type && m_name == other.m_name;
- }
+ friend size_t qHash(const Include &);
+ int compare(const Include &rhs) const;
- friend size_t qHash(const Include&);
private:
IncludeType m_type = IncludePath;
QString m_name;
};
size_t qHash(const Include& inc);
+
+inline bool operator<(const Include &lhs, const Include &rhs)
+{
+ return lhs.compare(rhs) < 0;
+}
+
+inline bool operator<=(const Include &lhs, const Include &rhs)
+{
+ return lhs.compare(rhs) <= 0;
+}
+
+inline bool operator==(const Include &lhs, const Include &rhs)
+{
+ return lhs.compare(rhs) == 0;
+}
+
+inline bool operator!=(const Include &lhs, const Include &rhs)
+{
+ return lhs.compare(rhs) != 0;
+}
+
+inline bool operator>=(const Include &lhs, const Include &rhs)
+{
+ return lhs.compare(rhs) >= 0;
+}
+
+inline bool operator>(const Include &lhs, const Include &rhs)
+{
+ return lhs.compare(rhs) > 0;
+}
+
QTextStream& operator<<(QTextStream& out, const Include& include);
TextStream& operator<<(TextStream& out, const Include& include);
#ifndef QT_NO_DEBUG_STREAM