Browse Source

Added Cursor::Type::get_cursor

merge-requests/37/head
eidheim 8 years ago
parent
commit
979a59647a
  1. 4
      src/cursor.cc
  2. 1
      src/cursor.h

4
src/cursor.cc

@ -10,6 +10,10 @@ clangmm::Cursor::Type clangmm::Cursor::Type::get_result() const {
return Type(clang_getResultType(cx_type)); return Type(clang_getResultType(cx_type));
} }
clangmm::Cursor clangmm::Cursor::Type::get_cursor() const {
return Cursor(clang_getTypeDeclaration(cx_type));
}
bool clangmm::Cursor::Type::operator==(const Cursor::Type& rhs) const { bool clangmm::Cursor::Type::operator==(const Cursor::Type& rhs) const {
return clang_equalTypes(cx_type, rhs.cx_type); return clang_equalTypes(cx_type, rhs.cx_type);
} }

1
src/cursor.h

@ -182,6 +182,7 @@ namespace clangmm {
Type(const CXType &cx_type) : cx_type(cx_type) {} Type(const CXType &cx_type) : cx_type(cx_type) {}
std::string get_spelling() const; std::string get_spelling() const;
Type get_result() const; Type get_result() const;
Cursor get_cursor() const;
bool operator==(const Cursor::Type& rhs) const; bool operator==(const Cursor::Type& rhs) const;
CXType cx_type; CXType cx_type;

Loading…
Cancel
Save