From d5bfee1b7e872c1de8ad01064e7c64cc1235fdad Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 8 Feb 2018 15:25:38 +0100 Subject: [PATCH] Added Cursor::hash() method --- src/cursor.cc | 4 ++++ src/cursor.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/cursor.cc b/src/cursor.cc index 9b01b9c..57110bc 100644 --- a/src/cursor.cc +++ b/src/cursor.cc @@ -195,6 +195,10 @@ bool clangmm::Cursor::operator==(const Cursor& rhs) const { return clang_equalCursors(cx_cursor, rhs.cx_cursor); } +unsigned clangmm::Cursor::hash() const { + return clang_hashCursor(cx_cursor); +} + bool clangmm::Cursor::is_valid_kind() const { auto referenced=clang_getCursorReferenced(cx_cursor); if(clang_Cursor_isNull(referenced)) diff --git a/src/cursor.h b/src/cursor.h index 4d521f8..24ec224 100644 --- a/src/cursor.h +++ b/src/cursor.h @@ -212,6 +212,7 @@ namespace clangmm { std::vector get_all_overridden_cursors() const; operator bool() const; bool operator==(const Cursor& rhs) const; + unsigned hash() const; bool is_valid_kind() const; std::string get_type_description() const;