aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/clangparser/clangutils.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/ApiExtractor/clangparser/clangutils.h')
-rw-r--r--sources/shiboken2/ApiExtractor/clangparser/clangutils.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangutils.h b/sources/shiboken2/ApiExtractor/clangparser/clangutils.h
index 5f005bd5d..41d0af460 100644
--- a/sources/shiboken2/ApiExtractor/clangparser/clangutils.h
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangutils.h
@@ -62,16 +62,24 @@ inline bool isCursorValid(const CXCursor &c)
return c.kind < CXCursor_FirstInvalid || c.kind > CXCursor_LastInvalid;
}
+QString getFileName(CXFile file); // Uncached,see BaseVisitor for a cached version
+
struct SourceLocation
{
- int compare(const SourceLocation &rhs) const;
+ bool equals(const SourceLocation &rhs) const;
- QString file;
+ CXFile file;
unsigned line = 0;
unsigned column = 0;
unsigned offset = 0;
};
+inline bool operator==(const SourceLocation &l1, const SourceLocation &l2)
+{ return l1.equals(l2); }
+
+inline bool operator!=(const SourceLocation &l1, const SourceLocation &l2)
+{ return !l1.equals(l2); }
+
SourceLocation getExpansionLocation(const CXSourceLocation &location);
using SourceRange =QPair<SourceLocation, SourceLocation>;