X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c57e060dc35e26d81cd091be409c12e7b406c5a0..74c481d11721fb42343c6b79996478a2ebacde3a:/docs/latex/wx/cmdlpars.tex?ds=sidebyside diff --git a/docs/latex/wx/cmdlpars.tex b/docs/latex/wx/cmdlpars.tex index 443c1bd4cb..7c708fccf0 100644 --- a/docs/latex/wx/cmdlpars.tex +++ b/docs/latex/wx/cmdlpars.tex @@ -6,7 +6,7 @@ %% Created: 27.03.00 %% RCS-ID: $Id$ %% Copyright: (c) Vadim Zeitlin -%% License: wxWindows license +%% License: wxWidgets license %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{\class{wxCmdLineParser}}\label{wxcmdlineparser} @@ -80,10 +80,10 @@ the following constants: \begin{verbatim} enum wxCmdLineEntryType { - wxCMD\_LINE\_SWITCH, - wxCMD\_LINE\_OPTION, - wxCMD\_LINE\_PARAM, - wxCMD\_LINE\_NONE // use this to terminate the list + wxCMD_LINE_SWITCH, + wxCMD_LINE_OPTION, + wxCMD_LINE_PARAM, + wxCMD_LINE_NONE // use this to terminate the list } \end{verbatim} } @@ -103,10 +103,10 @@ by an option or parameter are: \begin{verbatim} enum wxCmdLineParamType { - wxCMD\_LINE\_VAL\_STRING, // default - wxCMD\_LINE\_VAL\_NUMBER, - wxCMD\_LINE\_VAL\_DATE, - wxCMD\_LINE\_VAL\_NONE + wxCMD_LINE_VAL_STRING, // default + wxCMD_LINE_VAL_NUMBER, + wxCMD_LINE_VAL_DATE, + wxCMD_LINE_VAL_NONE } \end{verbatim} } @@ -117,11 +117,11 @@ Finally, the {\tt flags} field is a combination of the following bit masks: \begin{verbatim} enum { - wxCMD\_LINE\_OPTION\_MANDATORY = 0x01, // this option must be given - wxCMD\_LINE\_PARAM\_OPTIONAL = 0x02, // the parameter may be omitted - wxCMD\_LINE\_PARAM\_MULTIPLE = 0x04, // the parameter may be repeated - wxCMD\_LINE\_OPTION\_HELP = 0x08, // this option is a help request - wxCMD\_LINE\_NEEDS\_SEPARATOR = 0x10, // must have sep before the value + wxCMD_LINE_OPTION_MANDATORY = 0x01, // this option must be given + wxCMD_LINE_PARAM_OPTIONAL = 0x02, // the parameter may be omitted + wxCMD_LINE_PARAM_MULTIPLE = 0x04, // the parameter may be repeated + wxCMD_LINE_OPTION_HELP = 0x08, // this option is a help request + wxCMD_LINE_NEEDS_SEPARATOR = 0x10, // must have sep before the value } \end{verbatim} } @@ -178,7 +178,7 @@ combination of \helpref{AddSwitch}{wxcmdlineparseraddswitch}, Using constructors or \helpref{SetDesc}{wxcmdlineparsersetdesc} uses a (usually {\tt const static}) table containing the command line description. If you want -to decide which options to acccept during the run-time, using one of the +to decide which options to accept during the run-time, using one of the {\tt AddXXX()} functions above might be preferable. \membersection{Customization}\label{wxcmdlineparsercustomization} @@ -215,7 +215,7 @@ terminate after this) or a positive number if there was an error during the command line parsing. In the latter case, the appropriate error message and usage information are -logged by wxCmdLineParser itself using the standard wxWindows logging functions. +logged by wxCmdLineParser itself using the standard wxWidgets logging functions. \membersection{Getting results}\label{wxcmdlineparsergettingresults} @@ -227,8 +227,8 @@ For a simple switch, you will simply call \helpref{Found}{wxcmdlineparserfoundswitch} to determine if the switch was given or not, for an option or a parameter, you will call a version of {\tt Found()} which also returns the associated value in the provided variable. All -{\tt Found()} functions return TRUE if the switch or option were found in the -command line or FALSE if they were not specified. +{\tt Found()} functions return true if the switch or option were found in the +command line or false if they were not specified. %%%%%%%%%%%%% Methods in alphabetic order %%%%%%%%%%%%% \helponly{\insertatlevel{2}{ @@ -281,6 +281,14 @@ specifies the \helpref{command line description}{wxcmdlineparsersetdesc}. Same as \helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserstr}, but also specifies the \helpref{command line description}{wxcmdlineparsersetdesc}. +\membersection{wxCmdLineParser::ConvertStringToArgs}\label{wxcmdlineparserconvertstringtoargs} + +\func{static wxArrayString}{ConvertStringToArgs}{\param{const wxChar }{*cmdline}} + +Breaks down the string containing the full command line in words. The words are +separated by whitespace. The quotes can be used in the input string to quote +the white space and the back slashes can be used to quote the quotes. + \membersection{wxCmdLineParser::SetCmdLine}\label{wxcmdlineparsersetcmdlineargc} \func{void}{SetCmdLine}{\param{int }{argc}, \param{char** }{argv}} @@ -318,7 +326,7 @@ start. Default is {\tt "-"} for Unix, {\tt "-/"} for Windows. \membersection{wxCmdLineParser::EnableLongOptions}\label{wxcmdlineparserenablelongoptions} -\func{void}{EnableLongOptions}{\param{bool }{enable = TRUE}} +\func{void}{EnableLongOptions}{\param{bool }{enable = true}} Enable or disable support for the long options. @@ -327,13 +335,23 @@ them. \wxheading{See also} -\helpref{Customization}{wxcmdlineparsercustomization} +\helpref{Customization}{wxcmdlineparsercustomization} and \helpref{AreLongOptionsEnabled}{wxcmdlineparserarelongoptionsenabled} \membersection{wxCmdLineParser::DisableLongOptions}\label{wxcmdlineparserdisablelongoptions} \func{void}{DisableLongOptions}{\void} -Ientical to \helpref{EnableLongOptions(FALSE)}{wxcmdlineparserenablelongoptions}. +Identical to \helpref{EnableLongOptions(false)}{wxcmdlineparserenablelongoptions}. + +\membersection{wxCmdLineParser::AreLongOptionsEnabled}\label{wxcmdlineparserarelongoptionsenabled} + +\func{bool}{AreLongOptionsEnabled}{\void} + +Returns true if long options are enabled, otherwise false. + +\wxheading{See also} + +\helpref{EnableLongOptions}{wxcmdlineparserenablelongoptions} \membersection{wxCmdLineParser::SetLogo}\label{wxcmdlineparsersetlogo} @@ -397,12 +415,20 @@ Add a parameter of the given {\it type} to the command line description. \membersection{wxCmdLineParser::Parse}\label{wxcmdlineparserparse} -\func{int}{Parse}{\void} +\func{int}{Parse}{\param{bool }{giveUsage = {\tt true}}} Parse the command line, return $0$ if ok, $-1$ if {\tt "-h"} or {\tt "--help"} option was encountered and the help message was given or a positive value if a syntax error occured. +\wxheading{Parameters} + +\docparam{giveUsage}{If {\tt true} (default), the usage message is given if a +syntax error was encountered while parsing the command line or if help was +requested. If {\tt false}, only error messages about possible syntax errors +are given, use \helpref{Usage}{wxcmdlineparserusage} to show the usage message +from the caller if needed.} + \membersection{wxCmdLineParser::Usage}\label{wxcmdlineparserusage} \func{void}{Usage}{\void} @@ -419,27 +445,27 @@ will not be helpful to the user unless the descriptions were indeed specified. \constfunc{bool}{Found}{\param{const wxString\& }{name}} -Returns TRUE if the given switch was found, FALSE otherwise. +Returns true if the given switch was found, false otherwise. \membersection{wxCmdLineParser::Found}\label{wxcmdlineparserfoundstringoption} \constfunc{bool}{Found}{\param{const wxString\& }{name}, \param{wxString* }{value}} -Returns TRUE if an option taking a string value was found and stores the +Returns true if an option taking a string value was found and stores the value in the provided pointer (which should not be NULL). \membersection{wxCmdLineParser::Found}\label{wxcmdlineparserfoundintoption} \constfunc{bool}{Found}{\param{const wxString\& }{name}, \param{long* }{value}} -Returns TRUE if an option taking an integer value was found and stores +Returns true if an option taking an integer value was found and stores the value in the provided pointer (which should not be NULL). \membersection{wxCmdLineParser::Found}\label{wxcmdlineparserfounddateoption} \constfunc{bool}{Found}{\param{const wxString\& }{name}, \param{wxDateTime* }{value}} -Returns TRUE if an option taking a date value was found and stores the +Returns true if an option taking a date value was found and stores the value in the provided pointer (which should not be NULL). \membersection{wxCmdLineParser::GetParamCount}\label{wxcmdlineparsergetparamcount}