-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmi_resolver.hpp
More file actions
76 lines (56 loc) · 1.63 KB
/
Copy pathmi_resolver.hpp
File metadata and controls
76 lines (56 loc) · 1.63 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
68
69
70
71
72
73
74
75
76
#pragma once
#include <std_fs>
#include <stdfwd/optional>
#include <stdfwd/string_view>
#include <stdfwd/string>
//------------------------------------------------------------------------------
namespace fs {
class FileSystem;
}
namespace project {
class Project;
}
namespace cmake_project {
class Project;
}
//------------------------------------------------------------------------------
namespace model_includes {
class StdLibrary;
class ResolverContext;
enum class FileType;
//------------------------------------------------------------------------------
class Resolver
{
public:
using Path = stdfs::path;
using PathOpt = std::optional< Path >;
explicit Resolver( const fs::FileSystem & _fs );
PathOpt resolvePath(
const project::Project & _project,
const cmake_project::Project * _cmakeProject,
const Path & _startFile,
stdfwd::string_view _fileName,
PathOpt currentCMakeSourceFile
) const;
static FileType resolveFileType( const Path & _file );
private:
PathOpt checkInCurrentDir( const ResolverContext & _context ) const;
PathOpt findInIncludeFolders( const ResolverContext & _context ) const;
PathOpt findInIncludeFoldersInProject(
const ResolverContext & _context
) const;
PathOpt findInIncludeFoldersInCMakeProject(
const ResolverContext & _context
) const;
PathOpt findFile(
const Path & _projectDir,
const Path & _includeDir,
const std::string & _fileName
) const;
bool isExistFile( const Path & _filePath ) const;
static const StdLibrary & getStdLibrary();
private:
const fs::FileSystem & m_fs;
};
//------------------------------------------------------------------------------
}