From a17effb99d06b534bd3ed8e2723dc7da389bf8fc Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 6 Jan 2017 04:46:48 +0200 Subject: [PATCH] Attach component information to data source files --- source/datapackcomponent.cpp | 4 ++-- source/datasourcefile.cpp | 11 +++++++++++ source/datasourcefile.h | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 source/datasourcefile.cpp create mode 100644 source/datasourcefile.h 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 -- 2.45.2