]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/CDMUtilities.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / CDMUtilities.cpp
index 0149e8dbd5488000f8481549c1570bf5fe3b2070..d9ef9b7fff10d5504245a47aa2c825575e2fb3ad 100644 (file)
@@ -36,6 +36,7 @@
 
 #include<vector>
 #include<string>
+#include <cstdlib>
 
 namespace CDMUtilities
 {
@@ -92,4 +93,25 @@ namespace CDMUtilities
     return pathFixed;
 
   }
+
+  int openTextEditor(const std::string& file)
+  {
+    std::string command = TEXT_EDITOR;
+
+    if(file != "")
+      command += " \"" + file + "\" &";
+
+    return system(command.c_str());
+  }
+
+  int openFileExplorer(const std::string& file)
+    {
+      std::string command = FILE_EXPLORER;
+
+      if(file != "")
+        command += " \"" + file + "\" &";
+
+      return system(command.c_str());
+    }
+
 }