X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36ebb50aa330231b38bc6304483c3ac8539b2cd1..4e1ba52e0a6749942692db66e852994113eac1af:/src/common/cmdline.cpp diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index aa1f4b5edb..c1c1f2a530 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -86,7 +86,7 @@ struct wxCmdLineOption GetLongOptionName(lng).Len() == lng.Len(), wxT("Long option contains invalid characters") ); - + kind = k; @@ -189,7 +189,10 @@ struct wxCmdLineParserData // methods wxCmdLineParserData(); + void SetArguments(int argc, char **argv); +#if wxUSE_UNICODE void SetArguments(int argc, wxChar **argv); +#endif // wxUSE_UNICODE void SetArguments(const wxString& cmdline); int FindOption(const wxString& name); @@ -214,6 +217,18 @@ wxCmdLineParserData::wxCmdLineParserData() #endif } +void wxCmdLineParserData::SetArguments(int argc, char **argv) +{ + m_arguments.clear(); + + for ( int n = 0; n < argc; n++ ) + { + m_arguments.push_back(wxString::FromAscii(argv[n])); + } +} + +#if wxUSE_UNICODE + void wxCmdLineParserData::SetArguments(int argc, wxChar **argv) { m_arguments.clear(); @@ -224,6 +239,8 @@ void wxCmdLineParserData::SetArguments(int argc, wxChar **argv) } } +#endif // wxUSE_UNICODE + void wxCmdLineParserData::SetArguments(const wxString& cmdLine) { m_arguments.clear(); @@ -277,11 +294,20 @@ void wxCmdLineParser::Init() m_data = new wxCmdLineParserData; } +void wxCmdLineParser::SetCmdLine(int argc, char **argv) +{ + m_data->SetArguments(argc, argv); +} + +#if wxUSE_UNICODE + void wxCmdLineParser::SetCmdLine(int argc, wxChar **argv) { m_data->SetArguments(argc, argv); } +#endif // wxUSE_UNICODE + void wxCmdLineParser::SetCmdLine(const wxString& cmdline) { m_data->SetArguments(cmdline);