diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2009-12-21 18:03:28 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2009-12-21 18:03:28 +0000 |
| commit | 51e21a316be6e052251b3dfc7d671061ebd67cee (patch) | |
| tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /src/functionfilesin.cpp | |
| parent | ad6f4dfcc671d3f8d458c42b0992956f2a2cf979 (diff) | |
| download | build-51e21a316be6e052251b3dfc7d671061ebd67cee.tar.gz build-51e21a316be6e052251b3dfc7d671061ebd67cee.tar.bz2 build-51e21a316be6e052251b3dfc7d671061ebd67cee.tar.xz build-51e21a316be6e052251b3dfc7d671061ebd67cee.zip | |
Removed the old trunk contents. About to load up m3
Diffstat (limited to 'src/functionfilesin.cpp')
| -rw-r--r-- | src/functionfilesin.cpp | 58 |
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 | |||
| 7 | PluginInterface2(filesIn, FunctionFilesIn, Function, "Mike Buland", 0, 1 ); | ||
| 8 | |||
| 9 | FunctionFilesIn::FunctionFilesIn() | ||
| 10 | { | ||
| 11 | } | ||
| 12 | |||
| 13 | FunctionFilesIn::~FunctionFilesIn() | ||
| 14 | { | ||
| 15 | } | ||
| 16 | |||
| 17 | void 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 | |||
| 52 | Function *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 | |||
