X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..97f3b1e939c502a05f2717e52b44919c8254d61e:/include/wx/cmdline.h diff --git a/include/wx/cmdline.h b/include/wx/cmdline.h index dc1d4ee9da..97e9627d9f 100644 --- a/include/wx/cmdline.h +++ b/include/wx/cmdline.h @@ -17,10 +17,11 @@ #include "wx/string.h" #include "wx/arrstr.h" +#include "wx/cmdargs.h" #if wxUSE_CMDLINE_PARSER -class WXDLLIMPEXP_BASE wxDateTime; +class WXDLLIMPEXP_FWD_BASE wxDateTime; // ---------------------------------------------------------------------------- // constants @@ -64,13 +65,17 @@ enum wxCmdLineEntryType struct wxCmdLineEntryDesc { wxCmdLineEntryType kind; - const wxChar *shortName; - const wxChar *longName; - const wxChar *description; + const char *shortName; + const char *longName; + const char *description; wxCmdLineParamType type; int flags; }; +// the list of wxCmdLineEntryDesc objects should be terminated with this one +#define wxCMD_LINE_DESC_END \ + { wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_NONE, 0x0 } + // ---------------------------------------------------------------------------- // wxCmdLineParser is a class for parsing command line. // @@ -100,6 +105,8 @@ public: wxCmdLineParser(int argc, char **argv) { Init(); SetCmdLine(argc, argv); } #if wxUSE_UNICODE wxCmdLineParser(int argc, wxChar **argv) { Init(); SetCmdLine(argc, argv); } + wxCmdLineParser(int argc, const wxCmdLineArgsArray& argv) + { Init(); SetCmdLine(argc, argv); } #endif // wxUSE_UNICODE wxCmdLineParser(const wxString& cmdline) { Init(); SetCmdLine(cmdline); } @@ -112,6 +119,10 @@ public: #if wxUSE_UNICODE wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, wxChar **argv) { Init(); SetCmdLine(argc, argv); SetDesc(desc); } + wxCmdLineParser(const wxCmdLineEntryDesc *desc, + int argc, + const wxCmdLineArgsArray& argv) + { Init(); SetCmdLine(argc, argv); SetDesc(desc); } #endif // wxUSE_UNICODE wxCmdLineParser(const wxCmdLineEntryDesc *desc, const wxString& cmdline) { Init(); SetCmdLine(cmdline); SetDesc(desc); } @@ -120,6 +131,7 @@ public: void SetCmdLine(int argc, char **argv); #if wxUSE_UNICODE void SetCmdLine(int argc, wxChar **argv); + void SetCmdLine(int argc, const wxCmdLineArgsArray& argv); #endif // wxUSE_UNICODE void SetCmdLine(const wxString& cmdline); @@ -209,7 +221,7 @@ public: void Reset(); // break down the command line in arguments - static wxArrayString ConvertStringToArgs(const wxChar *cmdline); + static wxArrayString ConvertStringToArgs(const wxString& cmdline); private: // get usage string @@ -230,7 +242,7 @@ private: class WXDLLIMPEXP_BASE wxCmdLineParser { public: - static wxArrayString ConvertStringToArgs(const wxChar *cmdline); + static wxArrayString ConvertStringToArgs(const wxString& cmdline); }; #endif // wxUSE_CMDLINE_PARSER/!wxUSE_CMDLINE_PARSER