]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/CDMUtilities.h
Feature #1711
[crea.git] / lib / creaDevManagerLib / CDMUtilities.h
index 2b4f05bfcea9a505864c7969d26ea3964a9cf5df..10509896178dc2cd00e1240313a0b0e612fe9194 100644 (file)
 
 namespace CDMUtilities
 {
+  //path slash
+  #ifdef _WIN32
+    // ------ Windows
+    static std::string SLASH = "\\";
+  #elif __APPLE__
+    // ------ Apple
+    static std::string SLASH = "/";
+  #else
+    static std::string SLASH = "/";
+  #endif
+
+  //text editor program
+#ifdef _WIN32
+  // ------ Windows
+  //TODO: implementation for windows
+#elif __APPLE__
+  // ------ Apple
+  //TODO: implementation for apple
+#else
+  static std::string TEXT_EDITOR = "gedit";
+#endif
+
+  //file explorer program
+#ifdef _WIN32
+  // ------ Windows
+  //TODO: implementation for windows
+#elif __APPLE__
+  // ------ Apple
+  //TODO: implementation for apple
+#else
+  static std::string FILE_EXPLORER = "nautilus";
+#endif
+
+  //terminal program
+  #ifdef _WIN32
+    // ------ Windows
+    //TODO: implementation for windows
+  #elif __APPLE__
+    // ------ Apple
+    //TODO: implementation for apple
+  #else
+    static std::string TERMINAL = "gnome-terminal";
+  #endif
+
+
   struct splitter
   {
     enum empties_t { empties_ok, no_empties };
     template <typename Container>
-      static Container& split
-      (
-          Container& result,
-          const typename Container::value_type& s,
-          const typename Container::value_type& delimiters,
-          empties_t empties = empties_ok
-      );
+    static Container& split
+    (
+        Container& result,
+        const typename Container::value_type& s,
+        const typename Container::value_type& delimiters,
+        empties_t empties = empties_ok
+    );
   };
 
   const std::string fixPath(const std::string& path);
+
+  int openTextEditor(const std::string& file = "");
+  int openFileExplorer(const std::string& file = "");
+  int openFileWithCommand(const std::string& file, const std::string& command);
+  int openBBEditor();
+  int openCreaToolsTools();
+  int openTerminal(const std::string& command = "");
 };
 
 #endif /* CDMUTILITIES_H_ */