]> git.tdb.fi Git - builder.git/blob - source/component.h
Add command line options (not all of them work yet)
[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 #include "misc.h"
9
10 class Package;
11
12 class Component
13 {
14 public:
15         class Loader: public Msp::Parser::Loader
16         {
17         public:
18                 Loader(Component &);
19                 Component &get_object() { return comp; }
20         private:
21                 Component &comp;
22
23                 void source(const std::string &);
24         };
25         
26         enum Type
27         {
28                 PROGRAM,
29                 LIBRARY,
30                 MODULE,
31                 HEADERS
32         };
33
34         Component(Package &, Type, const std::string &);
35         const Package     &get_package() const         { return pkg; }
36         Type              get_type() const             { return type; }
37         const std::string &get_name() const            { return name; }
38         const PathList    &get_sources() const         { return sources; }
39         const BuildInfo   &get_build_info() const      { return build_info; }
40         bool              get_install() const          { return install; }
41         const std::string &get_install_headers() const { return install_headers; }
42         void              create_build_info();
43 protected:
44         Package     &pkg;
45         Type        type;
46         std::string name;
47         PathList    sources;
48         bool        install;
49         std::string install_headers;
50         BuildInfo   build_info;
51 };
52 typedef std::list<Component> ComponentList;
53
54 #endif