]> git.tdb.fi Git - builder.git/blobdiff - source/sourcefile.h
Move file-to-target mapping to a separate class
[builder.git] / source / sourcefile.h
index b1ec8294f578d796ab85f61cb83ea804ebe50b55..18d86045cdee8092c83e834371603ca93490c5e3 100644 (file)
@@ -1,21 +1,27 @@
 #ifndef SOURCEFILE_H_
 #define SOURCEFILE_H_
 
-#include "target.h"
+#include "filetarget.h"
 
 class Component;
 
-class SourceFile: public Target
+/**
+Represents a C or C++ source file.
+*/
+class SourceFile: public FileTarget
 {
-public:
-       SourceFile(Builder &, const Component *, const std::string &);
-       const std::list<std::string> &get_includes() const { return includes; }
-       const char *get_type() const { return "SourceFile"; }
-       void find_depends();
-       Action *build() { rebuild=false; return 0; }
 private:
        const Component *comp;
-       std::list<std::string> includes;
+       StringList includes;
+
+protected:
+       SourceFile(Builder &, const Msp::FS::Path &);
+public:
+       SourceFile(Builder &, const Component &, const Msp::FS::Path &);
+       virtual const char *get_type() const { return "SourceFile"; }
+       const StringList &get_includes() const { return includes; }
+       const Component *get_component() const { return comp; }
+       virtual void find_depends();
 };
 
 #endif