X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=packages%2Fstd%2Fsrc%2FbbstdFilesFromDirectory.h;fp=packages%2Fstd%2Fsrc%2FbbstdFilesFromDirectory.h;h=125909ba62a6373c58adf652d3ddde351af42092;hb=c429a5e1229f3dbc56e2d0100980c7e4a3506d89;hp=10ec9b226b5859ddfc23a3ce35da3f931db7ba54;hpb=6182fd299a7c70520dd8af586e99797a34c441ef;p=bbtk.git diff --git a/packages/std/src/bbstdFilesFromDirectory.h b/packages/std/src/bbstdFilesFromDirectory.h index 10ec9b2..125909b 100644 --- a/packages/std/src/bbstdFilesFromDirectory.h +++ b/packages/std/src/bbstdFilesFromDirectory.h @@ -2,51 +2,53 @@ #define __bbstdFilesFromDirectory_h_INCLUDED__ #include "bbtkAtomicBlackBox.h" #include "iostream" +#include "bbstd_EXPORT.h" namespace bbstd { -class /*BBTK_EXPORT*/ FilesFromDirectory - : - public bbtk::AtomicBlackBox -{ - BBTK_BLACK_BOX_INTERFACE(FilesFromDirectory,bbtk::AtomicBlackBox); -//================================================================== -/// User callback called in the box contructor -virtual void bbUserConstructor(); -/// User callback called in the box copy constructor -virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer); -/// User callback called in the box destructor -virtual void bbUserDestructor(); -//================================================================== - BBTK_DECLARE_INPUT(In,std::string); - BBTK_DECLARE_INPUT(Recursive,bool); - BBTK_DECLARE_OUTPUT(Out,std::vector); - BBTK_PROCESS(Process); - void Process(); - + class bbstd_EXPORT FilesFromDirectory + : + public bbtk::AtomicBlackBox + { + BBTK_BLACK_BOX_INTERFACE(FilesFromDirectory,bbtk::AtomicBlackBox); + //================================================================== + /// User callback called in the box contructor + virtual void bbUserConstructor(); + /// User callback called in the box copy constructor + virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer); + /// User callback called in the box destructor + virtual void bbUserDestructor(); + //================================================================== + BBTK_DECLARE_INPUT(In,std::string); + BBTK_DECLARE_INPUT(Recursive,bool); + BBTK_DECLARE_OUTPUT(Out,std::vector); + BBTK_PROCESS(Process); + void Process(); + private : - std::string NormalizePath(std::string const &pathname); - int Explore(std::string const &dirpath, bool recursive); + std::string NormalizePath(std::string const &pathname); + int Explore(std::string const &dirpath, bool recursive); + + /// List of file names + std::vector Filenames; + /// name of the root directory to explore + std::string DirName; + }; - /// List of file names - std::vector Filenames; - /// name of the root directory to explore - std::string DirName; -}; - -//================================================================= -// UserBlackBox description -BBTK_BEGIN_DESCRIBE_BLACK_BOX(FilesFromDirectory,bbtk::AtomicBlackBox); -BBTK_NAME("FilesFromDirectory"); -BBTK_AUTHOR("jpr@creatis.univ-lyon1.fr"); -BBTK_DESCRIPTION("returns the fullPathNames of the files in a Directory"); -BBTK_CATEGORY(""); -BBTK_INPUT(FilesFromDirectory,In,"Directory Name",std::string,""); -BBTK_INPUT(FilesFromDirectory,Recursive,"Recursive directory exploration",bool,""); + //================================================================= + // BlackBox description + BBTK_BEGIN_DESCRIBE_BLACK_BOX(FilesFromDirectory,bbtk::AtomicBlackBox); + BBTK_NAME("FilesFromDirectory"); + BBTK_AUTHOR("jpr@creatis.univ-lyon1.fr"); + BBTK_DESCRIPTION("returns the fullPathNames of the files in a Directory"); + BBTK_CATEGORY(""); + BBTK_INPUT(FilesFromDirectory,In,"Directory Name",std::string,""); + BBTK_INPUT(FilesFromDirectory,Recursive,"Recursive directory exploration",bool,""); + + BBTK_OUTPUT(FilesFromDirectory,Out,"FullPathNames of the files",std::vector,""); + BBTK_END_DESCRIBE_BLACK_BOX(FilesFromDirectory); -BBTK_OUTPUT(FilesFromDirectory,Out,"FullPathNames of the files",std::vector,""); -BBTK_END_DESCRIBE_BLACK_BOX(FilesFromDirectory); } // EO namespace bbstd