]> Creatis software - creaCLI.git/blobdiff - bbtk_Slicer_PKG/src/bbSlicerSlicerLibDirToBlackBoxSrc.h
NOTES:
[creaCLI.git] / bbtk_Slicer_PKG / src / bbSlicerSlicerLibDirToBlackBoxSrc.h
diff --git a/bbtk_Slicer_PKG/src/bbSlicerSlicerLibDirToBlackBoxSrc.h b/bbtk_Slicer_PKG/src/bbSlicerSlicerLibDirToBlackBoxSrc.h
new file mode 100644 (file)
index 0000000..0742501
--- /dev/null
@@ -0,0 +1,69 @@
+#ifndef __bbSlicerSlicerLibDirToBlackBoxSrc_h_INCLUDED__
+#define __bbSlicerSlicerLibDirToBlackBoxSrc_h_INCLUDED__
+
+#include "bbSlicer_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+
+#include <vector>
+
+#include <cstdlib>
+#include <sstream>
+#include <iostream>
+#include <fstream>
+
+#include <stdio.h>
+#include <dlfcn.h>
+#include <string.h>
+#include <dirent.h>
+
+#include <ModuleDescriptionParser.h>
+#include <ModuleParameterGroup.h>
+#include <ModuleDescription.h>
+#include <ModuleParameter.h>
+
+#include <ModuleDescriptionUtilities.h>
+
+#include "CreationTool.h"
+
+namespace bbSlicer {
+
+    class bbSlicer_EXPORT SlicerLibDirToBlackBoxSrc
+    :
+    public bbtk::AtomicBlackBox {
+        BBTK_BLACK_BOX_INTERFACE ( SlicerLibDirToBlackBoxSrc , bbtk::AtomicBlackBox ) ;
+        BBTK_DECLARE_INPUT ( LibDirectoryFullPath , std::string ) ;
+        BBTK_DECLARE_INPUT ( SrcDestinationDir , std::string ) ;
+        BBTK_PROCESS ( Process ) ;
+        void Process ( ) ;
+
+        ///     STD LD_OPEN CALLS       ///
+        char* getModuleDescription ( const std::string lib ) ;
+        ///     FILE RELATED     ///
+        void saveFile ( const std::string content , const std::string file_name ) ;
+        std::string loadFile ( const std::string filename ) ;
+        std::string loadDummyBody ( ) ;
+        std::string loadDummyHeader ( ) ;
+        ///     BBTK BOX CREATION       /// 
+        std::string updateBoxDescription ( const ModuleDescription* module , std::string _header ) ;
+        std::string updateBoxName ( const ModuleDescription* module , std::string content ) ;
+        std::string getHeaderFileName ( const ModuleDescription* module ) ;
+        std::string getBodyFileName ( const ModuleDescription* module ) ;
+        std::string updateBoxInputs ( const ModuleDescription* module , std::string content ) ;
+        const int getNumberOfArguments ( const ModuleDescription* module ) ;
+        std::string updateProcessMethod ( const ModuleDescription* module , std::string content , std::string lib ) ;
+        std::vector < std::string > getFilesByExtention ( std::string dir , std::string ext ) ;
+    } ;
+
+    BBTK_BEGIN_DESCRIBE_BLACK_BOX ( SlicerLibDirToBlackBoxSrc , bbtk::AtomicBlackBox ) ;
+    BBTK_NAME ( "SlicerLibDirToBlackBoxSrc" ) ;
+    BBTK_AUTHOR ( "Juan gabriel RIVEROS REYES" ) ;
+    BBTK_DESCRIPTION ( "Generates all C++ source code from all Slicers shared libs in a directory for later compilation" ) ;
+    BBTK_CATEGORY ( "" ) ;
+    BBTK_INPUT ( SlicerLibDirToBlackBoxSrc , LibDirectoryFullPath , "Full path to shared libraries' directory" , std::string , "" ) ;
+    BBTK_INPUT ( SlicerLibDirToBlackBoxSrc , SrcDestinationDir , "Source code destination directory" , std::string , "" ) ;
+    BBTK_END_DESCRIBE_BLACK_BOX ( SlicerLibDirToBlackBoxSrc ) ;
+
+}
+
+#endif
+