cbp2make
Makefile generation tool for Code::Blocks IDE
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
depsearch.h
Go to the documentation of this file.
1
/*
2
cbp2make : Makefile generation tool for the Code::Blocks IDE
3
Copyright (C) 2010-2013 Mirai Computing (mirai.computing@gmail.com)
4
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License
16
along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
//------------------------------------------------------------------------------
20
#ifndef DEPSEARCH_H
21
#define DEPSEARCH_H
22
//------------------------------------------------------------------------------
23
//#include <ostream>
24
//------------------------------------------------------------------------------
25
#include "
stlstrings.h
"
26
#include "
stringhash.h
"
27
#include "
platforms.h
"
28
#include "
makefile.h
"
29
//------------------------------------------------------------------------------
30
31
class
CDependencyInfo
;
32
33
class
CDependencyRecord
34
{
35
private
:
36
CString
m_Name
;
37
hash_t
m_Hash
;
38
std::vector<CDependencyRecord *>
m_Dependencies
;
39
std::vector<CDependencyRecord *>
m_CrossReferences
;
40
bool
m_DependenciesComplete
;
41
bool
m_CrossReferencesComplete
;
42
int
m_Marker
;
43
public
:
44
CString
GetName
(
void
)
const
{
return
m_Name
; };
45
void
SetName
(
const
CString
& Name);
46
hash_t
Hash
(
void
)
const
{
return
m_Hash
; }
47
size_t
DependenciesCount
(
void
)
const
;
48
CDependencyRecord
*
Dependency
(
const
size_t
Index)
const
;
49
void
AddDependency
(
const
CDependencyRecord
*Record);
50
size_t
CrossReferencesCount
(
void
)
const
;
51
CDependencyRecord
*
CrossReference
(
const
size_t
Index)
const
;
52
void
AddCrossReference
(
const
CDependencyRecord
*Record);
53
bool
&
DependenciesComplete
(
void
) {
return
m_DependenciesComplete
; }
54
bool
&
CrossReferencesComplete
(
void
) {
return
m_CrossReferencesComplete
; }
55
int
&
Marker
(
void
) {
return
m_Marker
; }
56
void
Clear
(
void
);
57
void
Show
(
void
);
58
public
:
59
CDependencyRecord
(
void
);
60
~CDependencyRecord
(
void
);
61
};
62
63
class
CDependencyInfo
64
{
65
private
:
66
CPlatform
m_Platform
;
67
std::vector<CDependencyRecord *>
m_Records
;
68
private
:
69
void
ResetMarkers
(
void
);
70
size_t
DependenciesCount
(
CDependencyRecord
*Record);
71
CStringList
Dependencies
(
CDependencyRecord
*Record);
72
size_t
CrossReferencesCount
(
CDependencyRecord
*Record);
73
CStringList
CrossReferences
(
CDependencyRecord
*Record);
74
public
:
75
CPlatform
&
Platform
(
void
) {
return
m_Platform
; }
76
void
Clear
(
void
);
77
void
Show
(
void
);
78
CString
OneLineReport
(
const
size_t
Index,
const
bool
Deps,
const
bool
XRefs);
79
size_t
RecordsCount
(
void
)
const
;
80
CString
Name
(
const
size_t
Index)
const
;
81
size_t
DirectDependenciesCount
(
const
size_t
Index)
const
;
82
size_t
IndirectDependenciesCount
(
const
size_t
Index);
83
size_t
AllDependenciesCount
(
const
size_t
Index);
84
CStringList
DirectDependencies
(
const
size_t
Index)
const
;
85
CStringList
IndirectDependencies
(
const
size_t
Index);
86
CStringList
AllDependencies
(
const
size_t
Index);
87
size_t
DirectCrossReferencesCount
(
const
size_t
Index)
const
;
88
size_t
IndirectCrossReferencesCount
(
const
size_t
Index);
89
size_t
AllCrossReferencesCount
(
const
size_t
Index);
90
CStringList
DirectCrossReferences
(
const
size_t
Index)
const
;
91
CStringList
IndirectCrossReferences
(
const
size_t
Index);
92
CStringList
AllCrossReferences
(
const
size_t
Index);
93
bool
AreDependenciesComplete
(
const
size_t
Index);
94
bool
AreCrossReferencesComplete
(
const
size_t
Index);
95
void
SetDependenciesComplete
(
const
size_t
Index,
const
bool
State =
true
);
96
void
SetCrossReferencesComplete
(
const
size_t
Index,
const
bool
State =
true
);
97
int
FindRecord
(
const
CString
&
Name
);
98
size_t
AddRecord
(
const
CString
&
Name
);
99
bool
AddDependency
(
const
size_t
Index,
const
CString
& DependencyName);
100
size_t
AddDependency
(
const
CString
&
Name
,
const
CString
& DependencyName);
101
void
MakeRules
(
CMakefile
& Makefile,
const
int
Section,
const
bool
Multiline);
102
public
:
103
CDependencyInfo
(
void
);
104
~CDependencyInfo
(
void
);
105
};
106
107
class
CIncludeSearchFilter
108
{
109
protected
:
110
CStringList
m_IncludeDirectories
;
111
CStringList
m_DefinedMacros
;
112
public
:
113
virtual
void
Clear
(
void
);
114
virtual
void
Show
(
void
);
115
virtual
void
Assign
(
const
CIncludeSearchFilter
& Filter);
116
virtual
bool
Execute
(
const
CString
& FileName,
CStringList
& Includes);
117
virtual
bool
Execute
(
const
CString
& FileName,
CDependencyInfo
& Dependencies);
118
void
AddIncludeDirectory
(
const
CString
& Path);
119
void
AddIncludeDirectories
(
const
CStringList
& Paths);
120
void
AddMacroDefiniton
(
const
CString
& Macro);
121
void
AddMacroDefinitons
(
const
CStringList
& Macros);
122
CString
ResolveIncludePath
(
const
CString
& IncludeName);
123
public
:
124
CIncludeSearchFilter
(
void
);
125
CIncludeSearchFilter
(
const
CIncludeSearchFilter
& Filter);
126
~CIncludeSearchFilter
(
void
);
127
};
128
129
class
CCppIncludeSearchFilter
:
public
CIncludeSearchFilter
130
{
131
public
:
132
virtual
void
Assign
(
const
CCppIncludeSearchFilter
& Filter);
133
virtual
bool
Execute
(
const
CString
& FileName,
CStringList
& Includes);
134
virtual
bool
Execute
(
const
CString
& FileName,
CDependencyInfo
& Dependencies);
135
public
:
136
CCppIncludeSearchFilter
(
void
);
137
CCppIncludeSearchFilter
(
const
CCppIncludeSearchFilter
& Filter);
138
~CCppIncludeSearchFilter
(
void
);
139
};
140
141
#endif
142
//------------------------------------------------------------------------------
Generated on Sun Jun 9 2013 10:55:52 for cbp2make by
1.8.4