-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmi_resolver.hpp
More file actions
67 lines (44 loc) · 1.29 KB
/
Copy pathmi_resolver.hpp
File metadata and controls
67 lines (44 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#include <stdfwd.hpp>
//------------------------------------------------------------------------------
namespace fs {
class FileSystem;
}
//------------------------------------------------------------------------------
namespace project {
class Project;
}
//------------------------------------------------------------------------------
namespace model_includes {
class StdLibrary;
enum class FileType;
//------------------------------------------------------------------------------
class Resolver
{
public:
using Path = stdfs::path;
using PathOpt = std::optional< Path >;
Resolver(
const fs::FileSystem & _fs,
const project::Project & _project
);
PathOpt resolvePath(
const Path & _startFile,
stdfwd::string_view _fileName
) const;
static FileType resolveFileType( const Path & _startFile );
private:
PathOpt checkInCurrentDir(
const Path & _startFile,
stdfwd::string_view _fileName
) const;
PathOpt findInIncludeFolders( stdfwd::string_view _fileName ) const;
bool isExistFile( const Path & _filePath ) const;
static const StdLibrary & getStdLibrary();
const Path & getProjectFolder() const;
private:
const fs::FileSystem & m_fs;
const project::Project & m_project;
};
//------------------------------------------------------------------------------
}