Commit ee128a07 authored by S's avatar S
Browse files

getting translation unit cursor

parent 5e0c3927
Pipeline #38599944 passed with stage
in 3 minutes and 10 seconds
......@@ -93,6 +93,10 @@ std::unique_ptr<clangmm::Tokens> clangmm::TranslationUnit::get_tokens(unsigned s
return std::unique_ptr<Tokens>(new Tokens(cx_tu, range));
}
clangmm::Cursor clangmm::TranslationUnit::get_cursor() {
return Cursor(clang_getTranslationUnitCursor(cx_tu));
}
clangmm::Cursor clangmm::TranslationUnit::get_cursor(const std::string &path, unsigned offset) {
SourceLocation location(cx_tu, path, offset);
return Cursor(clang_getCursor(cx_tu, location.cx_location));
......
......@@ -37,6 +37,7 @@ namespace clangmm {
std::unique_ptr<Tokens> get_tokens(unsigned start_line, unsigned start_column,
unsigned end_line, unsigned end_column);
Cursor get_cursor();
Cursor get_cursor(const std::string &path, unsigned offset);
Cursor get_cursor(const std::string &path, unsigned line, unsigned column);
Cursor get_cursor(const SourceLocation &location);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment