avoid needless Unicode<->MB conversions in Unix wxExecute(); simplify the code; provide both versions taking char** and wchar_t** for compatibility; also use wxMacExecute() (renamed to wxMacLaunch() to avoid confusion) from all wxExecute() overloads but don't use it if wxEXEC_SYNC was requested as it doesn't support it

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-03-23 02:27:23 +00:00
parent 0c1cc9483e
commit 05718a98f9
5 changed files with 255 additions and 219 deletions

View File

@@ -1012,9 +1012,11 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler)
return dwExitCode;
}
long wxExecute(wxChar **argv, int flags, wxProcess *handler)
template <typename CharType>
long wxExecuteImpl(CharType **argv, int flags, wxProcess *handler)
{
wxString command;
command.reserve(1024);
for ( ;; )
{
@@ -1022,8 +1024,18 @@ long wxExecute(wxChar **argv, int flags, wxProcess *handler)
if ( !*argv )
break;
command += _T(' ');
command += ' ';
}
return wxExecute(command, flags, handler);
}
long wxExecute(char **argv, int flags, wxProcess *handler)
{
return wxExecuteImpl(argv, flags, handler);
}
long wxExecute(wchar_t **argv, int flags, wxProcess *handler)
{
return wxExecuteImpl(argv, flags, handler);
}