Serenity Operating System
1/*
2 * Copyright (c) 2022, Itamar S. <itamar8910@gmail.com>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#include "FileDB.h"
8#include <AK/LexicalPath.h>
9
10namespace CodeComprehension {
11
12DeprecatedString FileDB::to_absolute_path(StringView filename) const
13{
14 if (LexicalPath { filename }.is_absolute()) {
15 return filename;
16 }
17 if (m_project_root.is_null())
18 return filename;
19 return LexicalPath { DeprecatedString::formatted("{}/{}", m_project_root, filename) }.string();
20}
21
22}