1 #ifndef __bbstdFilesFromDirectory_h_INCLUDED__
2 #define __bbstdFilesFromDirectory_h_INCLUDED__
3 #include "bbtkAtomicBlackBox.h"
5 #include "bbstd_EXPORT.h"
10 class bbstd_EXPORT FilesFromDirectory
12 public bbtk::AtomicBlackBox
14 BBTK_BLACK_BOX_INTERFACE(FilesFromDirectory,bbtk::AtomicBlackBox);
15 //==================================================================
16 /// User callback called in the box contructor
17 virtual void bbUserConstructor();
18 /// User callback called in the box copy constructor
19 virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
20 /// User callback called in the box destructor
21 virtual void bbUserDestructor();
22 //==================================================================
23 BBTK_DECLARE_INPUT(In,std::string);
24 BBTK_DECLARE_INPUT(Recursive,bool);
25 BBTK_DECLARE_OUTPUT(Out,std::vector<std::string>);
26 BBTK_PROCESS(Process);
30 std::string NormalizePath(std::string const &pathname);
31 int Explore(std::string const &dirpath, bool recursive);
33 /// List of file names
34 std::vector<std::string> Filenames;
35 /// name of the root directory to explore
39 //=================================================================
40 // BlackBox description
41 BBTK_BEGIN_DESCRIBE_BLACK_BOX(FilesFromDirectory,bbtk::AtomicBlackBox);
42 BBTK_NAME("FilesFromDirectory");
43 BBTK_AUTHOR("jpr@creatis.univ-lyon1.fr");
44 BBTK_DESCRIPTION("returns the fullPathNames of the files in a Directory");
46 BBTK_INPUT(FilesFromDirectory,In,"Directory Name",std::string,"");
47 BBTK_INPUT(FilesFromDirectory,Recursive,"Recursive directory exploration",bool,"");
49 BBTK_OUTPUT(FilesFromDirectory,Out,"FullPathNames of the files",std::vector<std::string>,"");
50 BBTK_END_DESCRIBE_BLACK_BOX(FilesFromDirectory);
55 #endif // __bbstdFilesFromDirectory_h_INCLUDED__