]> git.tdb.fi Git - builder.git/blobdiff - source/lib/task.cpp
Associate targets with FileTargets instead of paths
[builder.git] / source / lib / task.cpp
index e72a7415de285767ee93369051fb384113b8d2a1..870e068c76a9cab072c98eacfeff1b3450c76c19 100644 (file)
@@ -1,14 +1,15 @@
 #include <msp/fs/dir.h>
 #include <msp/fs/stat.h>
 #include <msp/fs/utils.h>
+#include "filetarget.h"
 #include "task.h"
 
 using namespace std;
 using namespace Msp;
 
-void Task::add_file(const FS::Path &f)
+void Task::add_target(const FileTarget &t)
 {
-       files.push_back(f);
+       targets.push_back(&t);
 }
 
 void Task::set_unlink(bool u)
@@ -18,8 +19,9 @@ void Task::set_unlink(bool u)
 
 void Task::prepare()
 {
-       for(const FS::Path &f: files)
+       for(const FileTarget *t: targets)
        {
+               const FS::Path &f = t->get_path();
                if(FS::exists(f))
                {
                        // If the file exists, the directory it's in must exist too