| Version: 3.0.5

- Main Page
- Related Pages
- Categories
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Enumerations
cmdline.h File Reference

## Classes

struct | wxCmdLineEntryDesc
| The structure wxCmdLineEntryDesc is used to describe a command line switch, option or parameter. More...
class | wxCmdLineParser
| wxCmdLineParser is a class for parsing the command line. More...

## Enumerations

enum | wxCmdLineEntryFlags { wxCMD_LINE_OPTION_MANDATORY = 0x01, wxCMD_LINE_PARAM_OPTIONAL = 0x02, wxCMD_LINE_PARAM_MULTIPLE = 0x04, wxCMD_LINE_OPTION_HELP = 0x08, wxCMD_LINE_NEEDS_SEPARATOR = 0x10, wxCMD_LINE_SWITCH_NEGATABLE = 0x20 }
| wxCmdLineEntryDesc::flags field is a combination of these bit masks. More...
enum | wxCmdLineParamType { wxCMD_LINE_VAL_STRING, wxCMD_LINE_VAL_NUMBER, wxCMD_LINE_VAL_DATE, wxCMD_LINE_VAL_DOUBLE, wxCMD_LINE_VAL_NONE }
| The possible values of wxCmdLineEntryDesc::type which specify the type of the value accepted by an option. More...
enum | wxCmdLineEntryType { wxCMD_LINE_SWITCH, wxCMD_LINE_OPTION, wxCMD_LINE_PARAM, wxCMD_LINE_USAGE_TEXT, wxCMD_LINE_NONE }
| The type of a command line entity used for wxCmdLineEntryDesc::kind. More...
enum | wxCmdLineSwitchState { wxCMD_SWITCH_OFF, wxCMD_SWITCH_ON }
| The state of a switch as returned by wxCmdLineParser::FoundSwitch(). More...
enum | wxCmdLineSplitType { wxCMD_LINE_SPLIT_DOS, wxCMD_LINE_SPLIT_UNIX }
| Flags determining wxCmdLineParser::ConvertStringToArgs() behaviour. More...

## Enumeration Type Documentation

enum wxCmdLineEntryFlags

wxCmdLineEntryDesc::flags field is a combination of these bit masks.

Notice that by default (i.e. if flags are just 0), options are optional (sic) and each call to wxCmdLineParser::AddParam() allows one more parameter - this may be changed by giving non-default flags to it, i.e. use `wxCMD_LINE_OPTION_MANDATORY` to require that the option is given and `wxCMD_LINE_PARAM_OPTIONAL` to make a parameter optional.

Also, `wxCMD_LINE_PARAM_MULTIPLE` may be specified if the programs accepts a variable number of parameters - but it only can be given for the last parameter in the command line description. If you use this flag, you will probably need to use wxCmdLineEntryDesc::GetParamCount() to retrieve the number of parameters effectively specified after calling wxCmdLineEntryDesc::Parse().

`wxCMD_LINE_NEEDS_SEPARATOR` can be specified to require a separator (either a colon, an equal sign or white space) between the option name and its value. By default, no separator is required.

`wxCMD_LINE_SWITCH_NEGATABLE` can be specified if you want to allow the user to specify the switch in both normal form and in negated one (e.g. /R-). You will need to use wxCmdLineParser::FoundSwitch() to distinguish between the normal and negated forms of the switch. This flag is new since wxWidgets 2.9.2.

Enumerator
wxCMD_LINE_OPTION_MANDATORY | This option must be given.
wxCMD_LINE_PARAM_OPTIONAL | The parameter may be omitted.
wxCMD_LINE_PARAM_MULTIPLE | The parameter may be repeated.
wxCMD_LINE_OPTION_HELP | This option is a help request.
wxCMD_LINE_NEEDS_SEPARATOR | Must have a separator before the value.
wxCMD_LINE_SWITCH_NEGATABLE | This switch can be negated (e.g. /S-)

enum wxCmdLineEntryType

The type of a command line entity used for wxCmdLineEntryDesc::kind.

Enumerator
wxCMD_LINE_SWITCH | A boolean argument of the program; e.g. `-v` to enable verbose mode.
wxCMD_LINE_OPTION | An argument with an associated value; e.g. `"-o filename"` to specify an optional output filename.
wxCMD_LINE_PARAM | A parameter: a required program argument.
wxCMD_LINE_USAGE_TEXT | Additional usage text. See wxCmdLineParser::AddUsageText.
wxCMD_LINE_NONE | Use this to terminate the list.

enum wxCmdLineParamType

The possible values of wxCmdLineEntryDesc::type which specify the type of the value accepted by an option.

Enumerator
wxCMD_LINE_VAL_STRING |
wxCMD_LINE_VAL_NUMBER |
wxCMD_LINE_VAL_DATE |
wxCMD_LINE_VAL_DOUBLE |
wxCMD_LINE_VAL_NONE |

enum wxCmdLineSplitType

Flags determining wxCmdLineParser::ConvertStringToArgs() behaviour.

Enumerator
wxCMD_LINE_SPLIT_DOS |
wxCMD_LINE_SPLIT_UNIX |

enum wxCmdLineSwitchState

The state of a switch as returned by wxCmdLineParser::FoundSwitch().

Since
  2.9.2

Enumerator
wxCMD_SWITCH_OFF | The switch was found in negated form, i.e. followed by a '-'.
wxCMD_SWITCH_ON | The switch was not found at all on the command line. The switch was found (and was not negated)