]> git.tdb.fi Git - builder.git/blob - source/component.h
c5e1d0ccb9a1a98b7296493ec32045a6129fd059
[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         };
31
32         Component(Package &, Type, const std::string &);
33         const Package &get_package() const { return pkg; }
34         Type get_type() const { return type; }
35         const std::string &get_name() const { return name; }
36         const Msp::Path::Path &get_source() const { return source; }
37         const BuildInfo &get_build_info() const { return build_info; }
38 protected:
39         Package     &pkg;
40         Type        type;
41         std::string name;
42         Msp::Path::Path source;
43         bool        install;
44         std::string install_headers;
45         BuildInfo   build_info;
46 };
47 typedef std::list<Component> ComponentList;
48
49 #endif