Serenity Operating System
1/*
2 * Copyright (c) 2022, Itamar S. <itamar8910@gmail.com>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <AK/DeprecatedString.h>
10#include <AK/StringView.h>
11
12namespace CodeComprehension {
13
14class FileDB {
15 AK_MAKE_NONCOPYABLE(FileDB);
16 AK_MAKE_NONMOVABLE(FileDB);
17
18public:
19 virtual ~FileDB() = default;
20
21 virtual Optional<DeprecatedString> get_or_read_from_filesystem(StringView filename) const = 0;
22 void set_project_root(StringView project_root) { m_project_root = project_root; }
23 DeprecatedString const& project_root() const { return m_project_root; }
24 DeprecatedString to_absolute_path(StringView filename) const;
25
26protected:
27 FileDB() = default;
28
29private:
30 DeprecatedString m_project_root;
31};
32
33}