X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftask.cpp;h=d969a7afa495f4c7076b5a8583b94679b0f25650;hb=3043044d8ef02ef77def454fdede87927f5aa1f8;hp=f6fa7b283e6c9b69b6c50cb9ad2d7d3707ac621f;hpb=33d74db3e99f35a8984d4ad9b703f709d07d44c5;p=builder.git diff --git a/source/task.cpp b/source/task.cpp index f6fa7b2..d969a7a 100644 --- a/source/task.cpp +++ b/source/task.cpp @@ -3,15 +3,16 @@ #include #include "task.h" +using namespace std; using namespace Msp; Task::Task(): unlink(false) { } -void Task::set_file(const FS::Path &f) +void Task::add_file(const FS::Path &f) { - file = f; + files.push_back(f); } void Task::set_unlink(bool u) @@ -21,16 +22,16 @@ void Task::set_unlink(bool u) void Task::prepare() { - if(!file.empty()) + for(const FS::Path &f: files) { - if(FS::exists(file)) + if(FS::exists(f)) { // If the file exists, the directory it's in must exist too - FS::unlink(file); + FS::unlink(f); } else { - FS::Path dir = FS::dirname(file); + FS::Path dir = FS::dirname(f); if(!FS::exists(dir)) FS::mkpath(dir, 0755); }