]> git.tdb.fi Git - builder.git/blob - source/architecture.h
Reorder class members
[builder.git] / source / architecture.h
1 /* $Id$
2
3 This file is part of builder
4 Copyright © 2007-2009  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 // XXX Add lib/exe prefix/suffix fields.  Some archs may need multiple alternatives, how to handle this?
17 class Architecture
18 {
19 public:
20         class Loader: public Msp::DataFile::Loader
21         {
22         private:
23                 Architecture &arch;
24
25         public:
26                 Loader(Architecture &);
27                 Architecture &get_object() { return arch; }
28         private:
29                 void tool(const std::string &t, const std::string &p);
30         };
31
32 private:
33         Builder &builder;
34         std::string name;
35         bool native;
36         std::string prefix;
37         StringMap tools;
38
39 public:
40         Architecture(Builder &b, const std::string &n, bool a=false);
41         void set_tool(const std::string &t, const std::string &p);
42         std::string get_tool(const std::string &t) const;
43         const std::string &get_name() const { return name; }
44         bool is_native() const { return native; }
45         const std::string &get_prefix() const { return prefix; }
46 };
47
48 typedef std::map<std::string, Architecture> ArchMap;
49
50 #endif