MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / getSourceFile

Method getSourceFile

engine/source/meta_parser/parser/cursor/cursor.cpp:28–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28std::string Cursor::getSourceFile(void) const
29{
30 auto range = clang_Cursor_getSpellingNameRange(m_handle, 0, 0);
31
32 auto start = clang_getRangeStart(range);
33
34 CXFile file;
35 unsigned line, column, offset;
36
37 clang_getFileLocation(start, &file, &line, &column, &offset);
38
39 std::string filename;
40
41 Utils::toString(clang_getFileName(file), filename);
42
43 return filename;
44}
45
46bool Cursor::isDefinition(void) const { return clang_isCursorDefinition(m_handle); }
47

Callers

nothing calls this directly

Calls 1

toStringFunction · 0.50

Tested by

no test coverage detected