]> Creatis software - creaCLI.git/blob - bbtk_Slicer_PKG/src/bbSlicerSlicerLibDirToBlackBoxSrc.h
NOTES:
[creaCLI.git] / bbtk_Slicer_PKG / src / bbSlicerSlicerLibDirToBlackBoxSrc.h
1 #ifndef __bbSlicerSlicerLibDirToBlackBoxSrc_h_INCLUDED__
2 #define __bbSlicerSlicerLibDirToBlackBoxSrc_h_INCLUDED__
3
4 #include "bbSlicer_EXPORT.h"
5 #include "bbtkAtomicBlackBox.h"
6
7 #include <vector>
8
9 #include <cstdlib>
10 #include <sstream>
11 #include <iostream>
12 #include <fstream>
13
14 #include <stdio.h>
15 #include <dlfcn.h>
16 #include <string.h>
17 #include <dirent.h>
18
19 #include <ModuleDescriptionParser.h>
20 #include <ModuleParameterGroup.h>
21 #include <ModuleDescription.h>
22 #include <ModuleParameter.h>
23
24 #include <ModuleDescriptionUtilities.h>
25
26 #include "CreationTool.h"
27
28 namespace bbSlicer {
29
30     class bbSlicer_EXPORT SlicerLibDirToBlackBoxSrc
31     :
32     public bbtk::AtomicBlackBox {
33         BBTK_BLACK_BOX_INTERFACE ( SlicerLibDirToBlackBoxSrc , bbtk::AtomicBlackBox ) ;
34         BBTK_DECLARE_INPUT ( LibDirectoryFullPath , std::string ) ;
35         BBTK_DECLARE_INPUT ( SrcDestinationDir , std::string ) ;
36         BBTK_PROCESS ( Process ) ;
37         void Process ( ) ;
38
39         ///     STD LD_OPEN CALLS       ///
40         char* getModuleDescription ( const std::string lib ) ;
41         ///     FILE RELATED     ///
42         void saveFile ( const std::string content , const std::string file_name ) ;
43         std::string loadFile ( const std::string filename ) ;
44         std::string loadDummyBody ( ) ;
45         std::string loadDummyHeader ( ) ;
46         ///     BBTK BOX CREATION       /// 
47         std::string updateBoxDescription ( const ModuleDescription* module , std::string _header ) ;
48         std::string updateBoxName ( const ModuleDescription* module , std::string content ) ;
49         std::string getHeaderFileName ( const ModuleDescription* module ) ;
50         std::string getBodyFileName ( const ModuleDescription* module ) ;
51         std::string updateBoxInputs ( const ModuleDescription* module , std::string content ) ;
52         const int getNumberOfArguments ( const ModuleDescription* module ) ;
53         std::string updateProcessMethod ( const ModuleDescription* module , std::string content , std::string lib ) ;
54         std::vector < std::string > getFilesByExtention ( std::string dir , std::string ext ) ;
55     } ;
56
57     BBTK_BEGIN_DESCRIBE_BLACK_BOX ( SlicerLibDirToBlackBoxSrc , bbtk::AtomicBlackBox ) ;
58     BBTK_NAME ( "SlicerLibDirToBlackBoxSrc" ) ;
59     BBTK_AUTHOR ( "Juan gabriel RIVEROS REYES" ) ;
60     BBTK_DESCRIPTION ( "Generates all C++ source code from all Slicers shared libs in a directory for later compilation" ) ;
61     BBTK_CATEGORY ( "" ) ;
62     BBTK_INPUT ( SlicerLibDirToBlackBoxSrc , LibDirectoryFullPath , "Full path to shared libraries' directory" , std::string , "" ) ;
63     BBTK_INPUT ( SlicerLibDirToBlackBoxSrc , SrcDestinationDir , "Source code destination directory" , std::string , "" ) ;
64     BBTK_END_DESCRIBE_BLACK_BOX ( SlicerLibDirToBlackBoxSrc ) ;
65
66 }
67
68 #endif
69