aboutsummaryrefslogtreecommitdiff
path: root/src/functionfilesin.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/functionfilesin.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/functionfilesin.cpp b/src/functionfilesin.cpp
deleted file mode 100644
index 5301cd2..0000000
--- a/src/functionfilesin.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
1#include <dirent.h>
2
3#include "functionfilesin.h"
4#include "bu/plugger.h"
5#include "build.h"
6
7PluginInterface2(filesIn, FunctionFilesIn, Function, "Mike Buland", 0, 1 );
8
9FunctionFilesIn::FunctionFilesIn()
10{
11}
12
13FunctionFilesIn::~FunctionFilesIn()
14{
15}
16
17void FunctionFilesIn::execute( Build *bld, const StringList &lInput, StringList &lOutput )
18{
19 DIR *d = opendir( lParams.front().c_str() );
20 if( d == NULL )
21 throw BuildException(
22 "Can't open directory %s.",
23 lParams.front().c_str()
24 );
25
26 struct dirent *e;
27
28 std::string prefix;
29 if( lParams.size() >= 2 )
30 {
31 StringList::iterator i = lParams.begin();
32 i++;
33 prefix = *i;
34 }
35 else
36 {
37 prefix = lParams.front() + "/";
38 }
39
40 while( (e = readdir( d )) )
41 {
42 if( e->d_type != DT_DIR )
43 {
44 if( e->d_name[0] != '.')
45 lOutput.push_back( prefix + e->d_name );
46 }
47 }
48
49 closedir( d );
50}
51
52Function *FunctionFilesIn::duplicate( Build &bld, const StringList *cont, VarMap *mExtra )
53{
54 Function *pRet = new FunctionFilesIn();
55 pRet->copyData( this, bld, cont, mExtra );
56 return pRet;
57}
58