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