[Jsmooth-cvs] jsmooth/skeletons/util-core StringUtils.cpp, 1.1, 1.2 StringUtils.h, 1.1, 1.2
Status: Beta
Brought to you by:
reyes
From: Rodrigo R. <re...@us...> - 2007-04-04 19:47:14
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/util-core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24631/skeletons/util-core Modified Files: StringUtils.cpp StringUtils.h Log Message: Fixed [ 1694330 ] Working directory handled incorrectly Fixed [ 1694128 ] launch in exe proc: '\' in command line not passed correctly Index: StringUtils.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-core/StringUtils.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StringUtils.cpp 1 Mar 2007 21:49:59 -0000 1.1 --- StringUtils.cpp 4 Apr 2007 19:47:10 -0000 1.2 *************** *** 275,276 **** --- 275,302 ---- return result; } + + std::string StringUtils::fixArgumentString(const std::string& arg) + { + string res; + for (int i=0; i<arg.length(); i++) + { + char c = arg[i]; + if (c == '\\') + { + if ((i + 1) < arg.length()) + { + if (arg[i+1] == '"') + { + res += "\\§§"; + } + } + else + { + res += '\\'; + } + } + + res += c; + } + return res; + } Index: StringUtils.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-core/StringUtils.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StringUtils.h 1 Mar 2007 21:49:59 -0000 1.1 --- StringUtils.h 4 Apr 2007 19:47:10 -0000 1.2 *************** *** 149,152 **** --- 149,154 ---- static string toLowerCase(const string& str); + + static std::string fixArgumentString(const std::string& arg); }; |