#include "wx/arrstr.h"
#include "wx/cmdargs.h"
+// determines ConvertStringToArgs() behaviour
+enum wxCmdLineSplitType
+{
+ wxCMD_LINE_SPLIT_DOS,
+ wxCMD_LINE_SPLIT_UNIX
+};
+
#if wxUSE_CMDLINE_PARSER
class WXDLLIMPEXP_FWD_BASE wxDateTime;
// by default, options are optional (sic) and each call to AddParam() allows
// one more parameter - this may be changed by giving non-default flags to it
-enum
+enum wxCmdLineEntryFlags
{
wxCMD_LINE_OPTION_MANDATORY = 0x01, // this option must be given
wxCMD_LINE_PARAM_OPTIONAL = 0x02, // the parameter may be omitted
wxCMD_LINE_SWITCH,
wxCMD_LINE_OPTION,
wxCMD_LINE_PARAM,
+ wxCMD_LINE_USAGE_TEXT,
wxCMD_LINE_NONE // to terminate the list
};
wxCmdLineParamType type = wxCMD_LINE_VAL_STRING,
int flags = 0);
+ // add an explanatory text to be shown to the user in help
+ void AddUsageText(const wxString& text);
+
// actions
// -------
void Reset();
// break down the command line in arguments
- static wxArrayString ConvertStringToArgs(const wxString& cmdline);
+ static wxArrayString
+ ConvertStringToArgs(const wxString& cmdline,
+ wxCmdLineSplitType type = wxCMD_LINE_SPLIT_DOS);
private:
// common part of all ctors
struct wxCmdLineParserData *m_data;
- DECLARE_NO_COPY_CLASS(wxCmdLineParser)
+ wxDECLARE_NO_COPY_CLASS(wxCmdLineParser);
};
#else // !wxUSE_CMDLINE_PARSER
class WXDLLIMPEXP_BASE wxCmdLineParser
{
public:
- static wxArrayString ConvertStringToArgs(const wxString& cmdline);
+ static wxArrayString
+ ConvertStringToArgs(const wxString& cmdline,
+ wxCmdLineSplitType type = wxCMD_LINE_SPLIT_DOS);
};
#endif // wxUSE_CMDLINE_PARSER/!wxUSE_CMDLINE_PARSER
#endif // _WX_CMDLINE_H_
-