]> git.tdb.fi Git - builder.git/commitdiff
Attach component information to data source files
authorMikko Rasa <tdb@tdb.fi>
Fri, 6 Jan 2017 02:46:48 +0000 (04:46 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 6 Jan 2017 02:46:48 +0000 (04:46 +0200)
source/datapackcomponent.cpp
source/datasourcefile.cpp [new file with mode: 0644]
source/datasourcefile.h [new file with mode: 0644]

index f936e9151e52c4cf501fb70dd1b5b162bcd5eb27..0b8d020eead41c9c0adc50056f60acca3fff6a47 100644 (file)
@@ -1,7 +1,7 @@
 #include <msp/fs/utils.h>
 #include "builder.h"
 #include "datapackcomponent.h"
-#include "file.h"
+#include "datasourcefile.h"
 #include "sourcepackage.h"
 #include "tool.h"
 
@@ -30,7 +30,7 @@ void DataPackComponent::create_targets() const
                else if(Target *tgt = builder.get_vfs().get_target(*i))
                        files.push_back(tgt);
                else
-                       files.push_back(new File(builder, package, *i));
+                       files.push_back(new DataSourceFile(builder, *this, *i));
        }
 
        Target *result = dcomp.create_target(files, "pack");
diff --git a/source/datasourcefile.cpp b/source/datasourcefile.cpp
new file mode 100644 (file)
index 0000000..b2a6d21
--- /dev/null
@@ -0,0 +1,11 @@
+#include "datasourcefile.h"
+
+using namespace Msp;
+
+DataSourceFile::DataSourceFile(Builder &b, const FS::Path &p):
+       SourceFile(b, p)
+{ }
+
+DataSourceFile::DataSourceFile(Builder &b, const Component &c, const FS::Path &p):
+       SourceFile(b, c, p)
+{ }
diff --git a/source/datasourcefile.h b/source/datasourcefile.h
new file mode 100644 (file)
index 0000000..23c2543
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef DATASOURCEFILE_H_
+#define DATASOURCEFILE_H_
+
+#include "sourcefile.h"
+
+class DataSourceFile: public SourceFile
+{
+public:
+       DataSourceFile(Builder &, const Msp::FS::Path &);
+       DataSourceFile(Builder &, const Component &, const Msp::FS::Path &);
+
+       virtual const char *get_type() const { return "DataSourceFile"; }
+};
+
+#endif