aboutsummaryrefslogtreecommitdiff
path: root/src/functionfilesin.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-08-23 22:09:30 +0000
committerMike Buland <eichlan@xagasoft.com>2006-08-23 22:09:30 +0000
commitd2fe7edb2bfea20987a1f69935179fa5fc9f3b37 (patch)
treeee35479f264788bf43b7904f31a528699b53e955 /src/functionfilesin.cpp
parent7a7390337e04d0163b97c1da7bdaa198bacaff72 (diff)
downloadbuild-d2fe7edb2bfea20987a1f69935179fa5fc9f3b37.tar.gz
build-d2fe7edb2bfea20987a1f69935179fa5fc9f3b37.tar.bz2
build-d2fe7edb2bfea20987a1f69935179fa5fc9f3b37.tar.xz
build-d2fe7edb2bfea20987a1f69935179fa5fc9f3b37.zip
Really close...functions are doing their stuff, we have inputs, almost have rules.
Diffstat (limited to 'src/functionfilesin.cpp')
-rw-r--r--src/functionfilesin.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/functionfilesin.cpp b/src/functionfilesin.cpp
index 0d65c13..3e1233a 100644
--- a/src/functionfilesin.cpp
+++ b/src/functionfilesin.cpp
@@ -1,5 +1,8 @@
1#include <dirent.h>
2
1#include "functionfilesin.h" 3#include "functionfilesin.h"
2#include "plugger.h" 4#include "plugger.h"
5#include "build.h"
3 6
4PluginInterface2(filesIn, FunctionFilesIn, Function, "Mike Buland", 0, 1 ); 7PluginInterface2(filesIn, FunctionFilesIn, Function, "Mike Buland", 0, 1 );
5 8
@@ -13,5 +16,25 @@ FunctionFilesIn::~FunctionFilesIn()
13 16
14void FunctionFilesIn::execute( const StringList &lInput, StringList &lOutput ) 17void FunctionFilesIn::execute( const StringList &lInput, StringList &lOutput )
15{ 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 = lParams.front() + "/";
29
30 while( (e = readdir( d )) )
31 {
32 if( e->d_type == DT_REG )
33 {
34 lOutput.push_back( prefix + e->d_name );
35 }
36 }
37
38 closedir( d );
16} 39}
17 40