X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FcreaDevManagerLib%2FCDMUtilities.cpp;h=f0a538e00ee124e2114a4a79cab2e0edc88c1864;hb=311bdcc514f85386f3bbbef9ff6a88bf69fd930f;hp=0149e8dbd5488000f8481549c1570bf5fe3b2070;hpb=b10bc326c058168a64969db6c6a29b91a3136fb3;p=crea.git diff --git a/lib/creaDevManagerLib/CDMUtilities.cpp b/lib/creaDevManagerLib/CDMUtilities.cpp index 0149e8d..f0a538e 100644 --- a/lib/creaDevManagerLib/CDMUtilities.cpp +++ b/lib/creaDevManagerLib/CDMUtilities.cpp @@ -36,6 +36,7 @@ #include #include +#include namespace CDMUtilities { @@ -82,14 +83,62 @@ namespace CDMUtilities //break path into folders std::vector pathSlpit; - splitter::split(pathSlpit, path, "/", splitter::no_empties); + splitter::split(pathSlpit, path, CDMUtilities::SLASH, splitter::no_empties); for (int i = 0; i < pathSlpit.size(); i++) { - pathFixed += "/" + pathSlpit[i]; + pathFixed += CDMUtilities::SLASH + pathSlpit[i]; } #endif 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()); + } + + int openFileWithCommand(const std::string& file, const std::string& command) + { + std::string comm = command; + if(file != "") + comm += " \"" + file + "\" &"; + + return system(comm.c_str()); + } + + int openBBEditor() + { + std::string comm = "bbEditor &"; + return system(comm.c_str()); + } + + int openCreaToolsTools() + { + std::string comm = "creaTools.sh &"; + return system(comm.c_str()); + } + + int openTerminal() + { + std::string comm = TERMINAL + "&"; + return system(comm.c_str()); + } + }