]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/CDMUtilities.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / CDMUtilities.cpp
index 29ed9c0371ffafc1c8dc9c973566fc8ca256d402..09e25f31c06d8a64f1ea9896d214a145f94e1a4d 100644 (file)
@@ -112,7 +112,8 @@ namespace CDMUtilities
     std::string command = TEXT_EDITOR;
 
     if(file != "")
-      command += " \"" + file + "\" &";
+      command += " \"" + file + "\"";
+    command += " &";
 
     return system(command.c_str());
   }
@@ -122,7 +123,8 @@ namespace CDMUtilities
     std::string command = FILE_EXPLORER;
 
     if(file != "")
-      command += " \"" + file + "\" &";
+      command += " \"" + file + "\"";
+    command += " &";
 
     return system(command.c_str());
   }
@@ -131,7 +133,8 @@ namespace CDMUtilities
   {
     std::string comm = command;
     if(file != "")
-      comm += " \"" + file + "\" &";
+      comm += " \"" + file + "\"";
+    comm += " &";
 
     return system(comm.c_str());
   }
@@ -144,7 +147,12 @@ namespace CDMUtilities
 
   int openCreaToolsTools()
   {
+#ifdef _WIN32
+    std::string comm = "creaTools &";
+#else
     std::string comm = "creaTools.sh &";
+#endif
+    
     return system(comm.c_str());
   }
 
@@ -305,4 +313,18 @@ namespace CDMUtilities
     return true;
   }
 
+  std::string stringify(const std::string& line)
+  {
+       std::string res;
+       for (int i = 0; i < line.size(); i++)
+       {
+         if(line[i] == '\\')
+           res.push_back('\\');
+         if(line[i] == '\"')
+           res.push_back('\\');
+         res.push_back(line[i]);
+       }
+       return res;
+  }
+
 }