]> git.tdb.fi Git - builder.git/blob - source/component.h
a27ddcab28a2ebaa4203b17726a3e702f03d4a97
[builder.git] / source / component.h
1 #ifndef COMPONENT_H_
2 #define COMPONENT_H_
3
4 #include <string>
5 #include <msp/parser/loader.h>
6 #include <msp/path/path.h>
7 #include "buildinfo.h"
8
9 class Package;
10
11 class Component
12 {
13 public:
14         class Loader: public Msp::Parser::Loader
15         {
16         public:
17                 Loader(Component &);
18                 Component &get_object() { return comp; }
19         private:
20                 Component &comp;
21
22                 void source(const std::string &);
23         };
24         
25         enum Type
26         {
27                 PROGRAM,
28                 LIBRARY,
29                 MODULE,
30                 HEADERS
31         };
32
33         Component(Package &, Type, const std::string &);
34         const Package     &get_package() const         { return pkg; }
35         Type              get_type() const             { return type; }
36         const std::string &get_name() const            { return name; }
37         const Msp::Path::Path &get_source() const      { return source; }
38         const BuildInfo   &get_build_info() const      { return build_info; }
39         bool              get_install() const          { return install; }
40         const std::string &get_install_headers() const { return install_headers; }
41         void              create_build_info();
42 protected:
43         Package     &pkg;
44         Type        type;
45         std::string name;
46         Msp::Path::Path source;
47         bool        install;
48         std::string install_headers;
49         BuildInfo   build_info;
50 };
51 typedef std::list<Component> ComponentList;
52
53 #endif