]> git.tdb.fi Git - builder.git/blob - source/architecture.h
Change arch and prefix to global options
[builder.git] / source / architecture.h
1 /* $Id$
2
3 This file is part of builder
4 Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef ARCHITECTURE_H_
9 #define ARCHITECTURE_H_
10
11 #include <msp/datafile/loader.h>
12 #include "misc.h"
13
14 class Builder;
15
16 class Architecture
17 {
18 public:
19         class Loader: public Msp::DataFile::Loader
20         {
21         public:
22                 Loader(Architecture &);
23                 Architecture &get_object() { return arch; }
24         private:
25                 Architecture &arch;
26
27                 void tool(const std::string &t, const std::string &p);
28         };
29
30         Architecture(Builder &b, const std::string &n);
31         void set_tool(const std::string &t, const std::string &p);
32         std::string get_tool(const std::string &t) const;
33         const std::string &get_name() const { return name; }
34         const std::string &get_prefix() const { return prefix; }
35 private:
36         Builder     &builder;
37         std::string name;
38         std::string prefix;
39         StringMap   tools;
40 };
41
42 typedef std::map<std::string, Architecture> ArchMap;
43
44 #endif