-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmi_file_impl.hpp
More file actions
54 lines (38 loc) · 1.47 KB
/
mi_file_impl.hpp
File metadata and controls
54 lines (38 loc) · 1.47 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
#pragma once
#include "model_includes/api/enums/mi_file_type.hpp"
#include "model_includes/api/mi_file.hpp"
#include <stdfwd/functional>
#include <std_fs>
#include <vector>
//------------------------------------------------------------------------------
namespace model_includes
{
//------------------------------------------------------------------------------
class FileImpl final : public File
{
public:
FileImpl( Path _path, FileType _type );
const Path & getPath() const override;
FileType getType() const override;
void addInclude( const Include & _include ) override;
IncludeIndex getIncludesCount() const override;
IncludeIndex getIncludeFilesCountRecursive() const override;
const Include & getInclude( IncludeIndex _index ) const override;
IncludeIndex getIncludedByCount() const override;
IncludeIndex getIncludedByFilesCountRecursive() const override;
const Include & getIncludedBy( IncludeIndex _index ) const override;
private:
using IncludesContainer = std::vector< const Include * >;
using IncludeCallback = std::function< void( const Include & ) >;
IncludeIndex getCountRecursive(
IncludeIndex ( File::*_getCount )() const,
const Include & ( File::*_getInclude )( IncludeIndex _index ) const,
const File & ( Include::*_getFile )() const ) const;
private:
IncludesContainer m_includes;
IncludesContainer m_includedBy;
const Path m_path;
const FileType m_type;
};
//------------------------------------------------------------------------------
}