-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathcprj_project_impl.hpp
More file actions
44 lines (32 loc) · 1.16 KB
/
cprj_project_impl.hpp
File metadata and controls
44 lines (32 loc) · 1.16 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
#pragma once
#include "cmake_project/api/cprj_project.hpp"
#include "tools/std_hash_fs_path.hpp"
#include <unordered_map>
#include <unordered_set>
#include <vector>
//------------------------------------------------------------------------------
namespace cmake_project
{
//------------------------------------------------------------------------------
class ProjectImpl final : public Project
{
public:
CountType getFilePathsCount() const override;
void forEachFilePath( PathCallback _callback ) const override;
void forEachIncludes(
const Path & _file, PathCallback _callback ) const override;
void addFilePath( const Path & _path ) override;
void addIncludeToFile( const Path & _file, const Path & _include ) override;
private:
const Path & addInclude( const Path & _include );
private:
using Files = std::unordered_set< Path >;
using Includes = std::unordered_set< Path >;
using IncludesForFile = std::vector< const Path * >;
using IncludesByFiles = std::unordered_map< Path, IncludesForFile >;
Files m_files;
Includes m_includes;
IncludesByFiles m_includesByFiles;
};
//------------------------------------------------------------------------------
}