Line |
Branch |
Exec |
Source |
1 |
|
|
// Copyright (c) 2021-2024 ChilliBits. All rights reserved. |
2 |
|
|
|
3 |
|
|
#pragma once |
4 |
|
|
|
5 |
|
|
#include <filesystem> |
6 |
|
|
#include <string> |
7 |
|
|
|
8 |
|
|
namespace spice::compiler { |
9 |
|
|
|
10 |
|
|
// Forward declarations |
11 |
|
|
class SourceFile; |
12 |
|
|
|
13 |
|
|
class CacheManager { |
14 |
|
|
public: |
15 |
|
|
// Constructors |
16 |
|
390 |
explicit CacheManager(const std::filesystem::path &cacheDir) : cacheDir(cacheDir) {} |
17 |
|
|
CacheManager(const CacheManager &) = delete; |
18 |
|
|
|
19 |
|
|
// Public methods |
20 |
|
|
bool lookupSourceFile(const SourceFile *sourceFile) const; |
21 |
|
|
void cacheSourceFile(const SourceFile *sourceFile); |
22 |
|
|
|
23 |
|
|
private: |
24 |
|
|
// Private members |
25 |
|
|
const std::filesystem::path &cacheDir; |
26 |
|
|
}; |
27 |
|
|
|
28 |
|
|
} // namespace spice::compiler |
29 |
|
|
|