X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bdee3769afe1cd8218568acbe16a31bf0df39aee..8df26961603924444b44272d34e0c2cab95cfdb5:/src/common/cmdline.cpp diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 45246ccb10..1b62b060a3 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -193,6 +193,7 @@ struct wxCmdLineParserData void SetArguments(int argc, char **argv); #if wxUSE_UNICODE void SetArguments(int argc, wxChar **argv); + void SetArguments(int argc, const wxCmdLineArgsArray& argv); #endif // wxUSE_UNICODE void SetArguments(const wxString& cmdline); @@ -240,6 +241,12 @@ void wxCmdLineParserData::SetArguments(int argc, wxChar **argv) } } +void wxCmdLineParserData::SetArguments(int WXUNUSED(argc), + const wxCmdLineArgsArray& argv) +{ + m_arguments = argv.GetArguments(); +} + #endif // wxUSE_UNICODE void wxCmdLineParserData::SetArguments(const wxString& cmdLine) @@ -310,6 +317,11 @@ void wxCmdLineParser::SetCmdLine(int argc, wxChar **argv) m_data->SetArguments(argc, argv); } +void wxCmdLineParser::SetCmdLine(int argc, const wxCmdLineArgsArray& argv) +{ + m_data->SetArguments(argc, argv); +} + #endif // wxUSE_UNICODE void wxCmdLineParser::SetCmdLine(const wxString& cmdline) @@ -357,17 +369,20 @@ void wxCmdLineParser::SetDesc(const wxCmdLineEntryDesc *desc) switch ( desc->kind ) { case wxCMD_LINE_SWITCH: - AddSwitch(desc->shortName, desc->longName, desc->description, + AddSwitch(desc->shortName, desc->longName, + wxGetTranslation(desc->description), desc->flags); break; case wxCMD_LINE_OPTION: - AddOption(desc->shortName, desc->longName, desc->description, + AddOption(desc->shortName, desc->longName, + wxGetTranslation(desc->description), desc->type, desc->flags); break; case wxCMD_LINE_PARAM: - AddParam(desc->description, desc->type, desc->flags); + AddParam(wxGetTranslation(desc->description), + desc->type, desc->flags); break; default: @@ -791,8 +806,7 @@ int wxCmdLineParser::Parse(bool showUsage) case wxCMD_LINE_VAL_DATE: { wxDateTime dt; - // FIXME-UTF8: ParseDate API will need changes - const wxChar *res = dt.ParseDate(value.c_str()); + const char *res = dt.ParseDate(value); if ( !res || *res ) { errorMsg << wxString::Format(_("Option '%s': '%s' cannot be converted to a date."),