]> Creatis software - bbtk.git/blobdiff - packages/std/src/bbstdMakeFileName.cxx
*** empty log message ***
[bbtk.git] / packages / std / src / bbstdMakeFileName.cxx
diff --git a/packages/std/src/bbstdMakeFileName.cxx b/packages/std/src/bbstdMakeFileName.cxx
new file mode 100644 (file)
index 0000000..73a6ece
--- /dev/null
@@ -0,0 +1,32 @@
+#include "bbstdMakeFileName.h"
+#include "bbstdPackage.h"
+#include "bbtkConfigurationFile.h"
+
+namespace bbstd
+{
+
+       BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,MakeFileName)
+       BBTK_USER_BLACK_BOX_IMPLEMENTATION(MakeFileName,bbtk::UserBlackBox);
+
+       void MakeFileName::bbUserConstructor()
+   {
+      bbSetInputDirectory("");
+      bbSetInputFile("");
+      bbSetInputExtent("");
+   }
+
+       void MakeFileName::DoProcess()
+       {
+      std::string fileSep = bbtk::ConfigurationFile::GetInstance().Get_file_separator();
+      std::string fullFileName = bbGetInputDirectory();
+      if ( fullFileName.c_str()[fullFileName.size()-1] != '/' && fullFileName.c_str()[fullFileName.size()-1] != '\\' )
+         fullFileName += fileSep;
+      fullFileName += bbGetInputFile();
+      if ( bbGetInputExtent() != "")
+         if ( bbGetInputExtent()[0] != '.' )
+            fullFileName += ".";
+      fullFileName +=  bbGetInputExtent();
+      bbSetOutputOut( fullFileName );    
+       }
+}
+// EO namespace bbstd