X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FCDMUtilities.cpp;h=09e25f31c06d8a64f1ea9896d214a145f94e1a4d;hb=327c33758d25e6ff1f90f9ab74ea219eaed934a9;hp=29ed9c0371ffafc1c8dc9c973566fc8ca256d402;hpb=eed967098aa87503c59d09c8d5c0dc87485698e2;p=crea.git diff --git a/lib/creaDevManagerLib/CDMUtilities.cpp b/lib/creaDevManagerLib/CDMUtilities.cpp index 29ed9c0..09e25f3 100644 --- a/lib/creaDevManagerLib/CDMUtilities.cpp +++ b/lib/creaDevManagerLib/CDMUtilities.cpp @@ -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; + } + }