aboutsummaryrefslogtreecommitdiff
path: root/src/functiondirectoriesin.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/functiondirectoriesin.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/functiondirectoriesin.cpp b/src/functiondirectoriesin.cpp
index 0e90dbc..105e98d 100644
--- a/src/functiondirectoriesin.cpp
+++ b/src/functiondirectoriesin.cpp
@@ -1,3 +1,5 @@
1#include <dirent.h>
2
1#include "functiondirectoriesin.h" 3#include "functiondirectoriesin.h"
2#include "plugger.h" 4#include "plugger.h"
3 5
@@ -13,6 +15,26 @@ FunctionDirectoriesIn::~FunctionDirectoriesIn()
13 15
14void FunctionDirectoriesIn::execute( Build *bld, const StringList &lInput, StringList &lOutput ) 16void FunctionDirectoriesIn::execute( Build *bld, const StringList &lInput, StringList &lOutput )
15{ 17{
18 DIR *d = opendir( lParams.front().c_str() );
19 if( d == NULL )
20 throw BuildException(
21 "Can't open directory %s.",
22 lParams.front().c_str()
23 );
24
25 struct dirent *e;
26
27 //std::string prefix = lParams.front() + "/";
28
29 while( (e = readdir( d )) )
30 {
31 if( e->d_type == DT_DIR )
32 {
33 lOutput.push_back( e->d_name );
34 }
35 }
36
37 closedir( d );
16} 38}
17 39
18Function *FunctionDirectoriesIn::duplicate( Build &bld, const std::string &cont, VarMap *mExtra ) 40Function *FunctionDirectoriesIn::duplicate( Build &bld, const std::string &cont, VarMap *mExtra )