From: Mikko Rasa Date: Fri, 6 Jan 2017 02:46:48 +0000 (+0200) Subject: Attach component information to data source files X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=a17effb99d06b534bd3ed8e2723dc7da389bf8fc;p=builder.git Attach component information to data source files --- diff --git a/source/datapackcomponent.cpp b/source/datapackcomponent.cpp index f936e91..0b8d020 100644 --- a/source/datapackcomponent.cpp +++ b/source/datapackcomponent.cpp @@ -1,7 +1,7 @@ #include #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 index 0000000..b2a6d21 --- /dev/null +++ b/source/datasourcefile.cpp @@ -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 index 0000000..23c2543 --- /dev/null +++ b/source/datasourcefile.h @@ -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