1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:57:45 +00:00

LibDebug: Add LineProgram::get_directory_and_file(size_t)

This function returns the directory path & filename for a given file
index.
This commit is contained in:
Itamar 2021-06-18 15:59:24 +03:00 committed by Andreas Kling
parent 0d89f70b66
commit 98a774a68d
2 changed files with 15 additions and 0 deletions

View file

@ -290,4 +290,13 @@ void LineProgram::run_program()
}
}
LineProgram::DirectoryAndFile LineProgram::get_directory_and_file(size_t file_index) const
{
VERIFY(file_index < m_source_files.size());
auto file_entry = m_source_files[file_index];
VERIFY(file_entry.directory_index < m_source_directories.size());
auto directory_entry = m_source_directories[file_entry.directory_index];
return { directory_entry, file_entry.name };
}
}