X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FCDMUtilities.h;h=4558c18315f407225ef0e71dfbf3f02ff286ed02;hb=refs%2Fheads%2Fvtk7itk4wx3-mingw64;hp=92fe3d0cbd409b2cb531711fefd252da8a77b1da;hpb=0cc6a7e002ad79de9453517108d7456fd44ddfdb;p=crea.git diff --git a/lib/creaDevManagerLib/CDMUtilities.h b/lib/creaDevManagerLib/CDMUtilities.h index 92fe3d0..4558c18 100644 --- a/lib/creaDevManagerLib/CDMUtilities.h +++ b/lib/creaDevManagerLib/CDMUtilities.h @@ -93,6 +93,15 @@ namespace CDMUtilities static std::string TERMINAL = "gnome-terminal"; #endif + +//EED 10/07/2013 +//#ifndef _WIN32 + /** + * Build Command + */ + static std::string BUILD_COMMAND = "make"; +//#endif + /** * Structure that handles the split method for c++ * It calls the split method to split a string given certain delimiters. @@ -118,7 +127,29 @@ namespace CDMUtilities const typename Container::value_type& s, const typename Container::value_type& delimiters, empties_t empties = empties_ok - ); + ) + { + result.clear(); + size_t current; + size_t next = -1; + do + { + if (empties == no_empties) + { + next = s.find_first_not_of(delimiters, next + 1); + if (next == Container::value_type::npos) + { + break; + } + next -= 1; + } + current = next + 1; + next = s.find_first_of(delimiters, current); + result.push_back(s.substr(current, next - current)); + } + while (next != Container::value_type::npos); + return result; + } }; /** @@ -144,9 +175,10 @@ namespace CDMUtilities * Opens a file with a given command. * @param file Full path of the file to open. * @param command Command to execute the file with. + * @param parameters Parameters to open file. * @return True if there was an error on the execution of the operation. */ - int openFileWithCommand(const std::string& file, const std::string& command); + int openFileWithCommand(const std::string& file, const std::string& command, const std::string& parameters = ""); /** * Opens the BBTK Graphical Editor * @return True if there was an error on the execution of the operation.