]> git.tdb.fi Git - builder.git/blob - source/lib/toolchain.h
Add visibility decorations to the library and plugins
[builder.git] / source / lib / toolchain.h
1 #ifndef TOOLCHAIN_H_
2 #define TOOLCHAIN_H_
3
4 #include <map>
5 #include <string>
6 #include <vector>
7 #include "libbuilder_api.h"
8
9 class Tool;
10
11 /**
12 A container for tools.  Performs lookup based on tag or filename extension.
13 */
14 class LIBBUILDER_API Toolchain
15 {
16 private:
17         std::string name;
18         int priority = 0;
19         std::map<std::string, Tool *> tools;
20         std::vector<Toolchain *> chains;
21
22 protected:
23         Toolchain(const std::string &n, unsigned p): name(n), priority(p) { }
24 public:
25         Toolchain() = default;
26         ~Toolchain();
27
28         const std::string &get_name() const { return name; }
29         int get_priority() const { return priority; }
30         void add_tool(Tool *);
31         void add_toolchain(Toolchain *);
32         bool has_tool(const std::string &) const;
33         Tool &get_tool(const std::string &) const;
34         Tool *get_tool_for_suffix(const std::string &, bool = false) const;
35         const std::vector<Toolchain *> &get_toolchains() { return chains; }
36 };
37
38 #endif