]> Creatis software - crea.git/blobdiff - src/creaSystem.cxx
no message
[crea.git] / src / creaSystem.cxx
index 7225884dd445252b2f44d9c45a0727eb4a4c24ed..7060109e434f87863f3ceb596a8ff3b0732c7198 100644 (file)
@@ -183,4 +183,33 @@ std::string System::GetDllAppPath(std::string nomdll){
        return path;
 }
 
+
+       
+#if defined(_WIN32)
+#define CREACONTOUR_VALID_FILE_SEPARATOR_CHAR '\\'
+#else
+#define CREACONTOUR_VALID_FILE_SEPARATOR_CHAR '/'
+#endif 
+       
+       //=========================================================================
+std::string System::GetExecutablePath(){
+               char name[PATH_MAX];
+               //EED    int err = get_app_path(name, PATH_MAX);
+               int err = System::GetAppPath(name,PATH_MAX);
+               if (err) 
+               {
+                       printf("Could not determine current executable path ?  ");  
+               }    
+               // remove the exe name
+               char *slash;            
+               slash = strrchr(name, CREACONTOUR_VALID_FILE_SEPARATOR_CHAR);
+               if (slash)
+               {
+                       *slash = 0;
+               }
+               return name;
+       }
+       
+       
+       
 } // namespace crea