]> git.tdb.fi Git - builder.git/blob - source/tool.cpp
Add SubTool class
[builder.git] / source / tool.cpp
1 #include <algorithm>
2 #include "tool.h"
3
4 using namespace std;
5
6 Tool::Tool(Builder &b, const string &t):
7         builder(b),
8         tag(t)
9 { }
10
11 bool Tool::accepts_suffix(const string &suffix, bool aux) const
12 {
13         if(find(input_suffixes.begin(), input_suffixes.end(), suffix)!=input_suffixes.end())
14                 return true;
15         else if(aux)
16                 return find(aux_suffixes.begin(), aux_suffixes.end(), suffix)!=aux_suffixes.end();
17         else
18                 return false;
19 }
20
21 Target *Tool::create_target(Target &source, const string &arg) const
22 {
23         list<Target *> sources;
24         sources.push_back(&source);
25         return create_target(sources, arg);
26 }
27
28
29 SubTool::SubTool(Tool &p):
30         Tool(p),
31         parent(p)
32 { }