diff options
Diffstat (limited to 'sources/shiboken2/ApiExtractor/clangparser/clangparser.h')
-rw-r--r-- | sources/shiboken2/ApiExtractor/clangparser/clangparser.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangparser.h b/sources/shiboken2/ApiExtractor/clangparser/clangparser.h index 4248be853..825de331c 100644 --- a/sources/shiboken2/ApiExtractor/clangparser/clangparser.h +++ b/sources/shiboken2/ApiExtractor/clangparser/clangparser.h @@ -45,12 +45,15 @@ class SourceFileCache { public: using Snippet = QPair<const char *, const char *>; - Snippet getCodeSnippet(const CXCursor &cursor); + Snippet getCodeSnippet(const CXCursor &cursor, QString *errorMessage = nullptr); + QString getFileName(CXFile file); private: - using FileBufferCache = QHash<QString, QByteArray>; + using FileBufferCache = QHash<CXFile, QByteArray>; + using FileNameCache = QHash<CXFile, QString>; FileBufferCache m_fileBufferCache; + FileNameCache m_fileNameCache; }; class BaseVisitor { @@ -74,6 +77,8 @@ public: StartTokenResult cbHandleStartToken(const CXCursor &cursor); bool cbHandleEndToken(const CXCursor &cursor, StartTokenResult startResult); + QString getFileName(CXFile file) { return m_fileCache.getFileName(file); } + CodeSnippet getCodeSnippet(const CXCursor &cursor); QString getCodeSnippetString(const CXCursor &cursor); |