⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmdlpars.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
📖 第 1 页 / 共 2 页
字号:
Unicode programs.\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserstr}\func{}{wxCmdLineParser}{\param{const wxString\& }{cmdline}}Constructor specifies the command line to parse in Windows format. The parameter {\it cmdline} has the same meaning as the corresponding parameter of {\tt WinMain()}.\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserdesc}\func{}{wxCmdLineParser}{\param{const wxCmdLineEntryDesc* }{desc}}Same as \helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserdef}, but alsospecifies the \helpref{command line description}{wxcmdlineparsersetdesc}.\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserdescargc}\func{}{wxCmdLineParser}{\param{const wxCmdLineEntryDesc* }{desc}, \param{int }{argc}, \param{char** }{argv}}Same as \helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserargc}, but alsospecifies the \helpref{command line description}{wxcmdlineparsersetdesc}.\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserdescstr}\func{}{wxCmdLineParser}{\param{const wxCmdLineEntryDesc* }{desc}, \param{const wxString\& }{cmdline}}Same as \helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserstr}, but alsospecifies 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 areseparated by whitespace. The quotes can be used in the input string to quotethe 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}}\func{void}{SetCmdLine}{\param{int }{argc}, \param{wchar\_t** }{argv}}Set command line to parse after using one of the constructors which don't do it.The second overload of this function is only available in Unicode build.\wxheading{See also}\helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserargc}\membersection{wxCmdLineParser::SetCmdLine}\label{wxcmdlineparsersetcmdlinestr}\func{void}{SetCmdLine}{\param{const wxString\& }{cmdline}}Set command line to parse after using one of the constructors which don't do it.\wxheading{See also}\helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserstr}\membersection{wxCmdLineParser::\destruct{wxCmdLineParser}}\label{wxcmdlineparserdtor}\func{}{\destruct{wxCmdLineParser}}{\void}Frees resources allocated by the object.{\bf NB:} destructor is not virtual, don't use this class polymorphically.\membersection{wxCmdLineParser::SetSwitchChars}\label{wxcmdlineparsersetswitchchars}\func{void}{SetSwitchChars}{\param{const wxString\& }{switchChars}}{\it switchChars} contains all characters with which an option or switch maystart. Default is {\tt "-"} for Unix, {\tt "-/"} for Windows.\membersection{wxCmdLineParser::EnableLongOptions}\label{wxcmdlineparserenablelongoptions}\func{void}{EnableLongOptions}{\param{bool }{enable = true}}Enable or disable support for the long options.As long options are not (yet) POSIX-compliant, this option allows to disablethem.\wxheading{See also}\helpref{Customization}{wxcmdlineparsercustomization} and \helpref{AreLongOptionsEnabled}{wxcmdlineparserarelongoptionsenabled}\membersection{wxCmdLineParser::DisableLongOptions}\label{wxcmdlineparserdisablelongoptions}\func{void}{DisableLongOptions}{\void}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}\func{void}{SetLogo}{\param{const wxString\& }{logo}}{\it logo} is some extra text which will be shown by \helpref{Usage}{wxcmdlineparserusage} method.\membersection{wxCmdLineParser::SetDesc}\label{wxcmdlineparsersetdesc}\func{void}{SetDesc}{\param{const wxCmdLineEntryDesc* }{desc}}Construct the command line descriptionTake the command line description from the wxCMD\_LINE\_NONE terminated table.Example of usage:\begin{verbatim}static const wxCmdLineEntryDesc cmdLineDesc[] ={    { wxCMD_LINE_SWITCH, "v", "verbose", "be verbose" },    { wxCMD_LINE_SWITCH, "q", "quiet",   "be quiet" },    { wxCMD_LINE_OPTION, "o", "output",  "output file" },    { wxCMD_LINE_OPTION, "i", "input",   "input dir" },    { wxCMD_LINE_OPTION, "s", "size",    "output block size", wxCMD_LINE_VAL_NUMBER },    { wxCMD_LINE_OPTION, "d", "date",    "output file date", wxCMD_LINE_VAL_DATE },    { wxCMD_LINE_PARAM,  NULL, NULL, "input file", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE },    { wxCMD_LINE_NONE }};wxCmdLineParser parser;parser.SetDesc(cmdLineDesc);\end{verbatim}\membersection{wxCmdLineParser::AddSwitch}\label{wxcmdlineparseraddswitch}\func{void}{AddSwitch}{\param{const wxString\& }{name}, \param{const wxString\& }{lng = wxEmptyString}, \param{const wxString\& }{desc = wxEmptyString}, \param{int }{flags = 0}}Add a switch {\it name} with an optional long name {\it lng} (no long name if itis empty, which is default), description {\it desc} and flags {\it flags} to thecommand line description.\membersection{wxCmdLineParser::AddOption}\label{wxcmdlineparseraddoption}\func{void}{AddOption}{\param{const wxString\& }{name}, \param{const wxString\& }{lng = wxEmptyString}, \param{const wxString\& }{desc = wxEmptyString}, \param{wxCmdLineParamType }{type = wxCMD\_LINE\_VAL\_STRING}, \param{int }{flags = 0}}Add an option {\it name} with an optional long name {\it lng} (no long name ifit is empty, which is default) taking a value of the given type (string bydefault) to the command line description.\membersection{wxCmdLineParser::AddParam}\label{wxcmdlineparseraddparam}\func{void}{AddParam}{\param{const wxString\& }{desc = wxEmptyString}, \param{wxCmdLineParamType }{type = wxCMD\_LINE\_VAL\_STRING}, \param{int }{flags = 0}}Add a parameter of the given {\it type} to the command line description.\membersection{wxCmdLineParser::Parse}\label{wxcmdlineparserparse}\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 asyntax error occurred.\wxheading{Parameters}\docparam{giveUsage}{If {\tt true} (default), the usage message is given if asyntax error was encountered while parsing the command line or if help wasrequested. If {\tt false}, only error messages about possible syntax errorsare given, use \helpref{Usage}{wxcmdlineparserusage} to show the usage messagefrom the caller if needed.}\membersection{wxCmdLineParser::Usage}\label{wxcmdlineparserusage}\func{void}{Usage}{\void}Give the standard usage message describing all program options. It will use theoptions and parameters descriptions specified earlier, so the resulting messagewill not be helpful to the user unless the descriptions were indeed specified.\wxheading{See also}\helpref{SetLogo}{wxcmdlineparsersetlogo}\membersection{wxCmdLineParser::Found}\label{wxcmdlineparserfoundswitch}\constfunc{bool}{Found}{\param{const wxString\& }{name}}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 thevalue 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 storesthe 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 thevalue in the provided pointer (which should not be NULL).\membersection{wxCmdLineParser::GetParamCount}\label{wxcmdlineparsergetparamcount}\constfunc{size\_t}{GetParamCount}{\void}Returns the number of parameters found. This function makes sense mostly if youhad used {\tt wxCMD\_LINE\_PARAM\_MULTIPLE} flag.\membersection{wxCmdLineParser::GetParam}\label{wxcmdlineparsergetparam}\constfunc{wxString}{GetParam}{\param{size\_t }{n = 0u}}Returns the value of Nth parameter (as string only for now).\wxheading{See also}\helpref{GetParamCount}{wxcmdlineparsergetparamcount}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -