added SetCmdLine(int, char **) overload even when building a Unicode app
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -150,6 +150,7 @@ console sample
|
|||||||
%%%%%%%%%%%%% Methods by group %%%%%%%%%%%%%
|
%%%%%%%%%%%%% Methods by group %%%%%%%%%%%%%
|
||||||
\latexignore{\rtfignore{\wxheading{Function groups}}}
|
\latexignore{\rtfignore{\wxheading{Function groups}}}
|
||||||
|
|
||||||
|
|
||||||
\membersection{Construction}\label{wxcmdlineparserconstruction}
|
\membersection{Construction}\label{wxcmdlineparserconstruction}
|
||||||
|
|
||||||
Before \helpref{Parse}{wxcmdlineparserparse} can be called, the command line
|
Before \helpref{Parse}{wxcmdlineparserparse} can be called, the command line
|
||||||
@@ -181,6 +182,7 @@ Using constructors or \helpref{SetDesc}{wxcmdlineparsersetdesc} uses a (usually
|
|||||||
to decide which options to accept 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.
|
{\tt AddXXX()} functions above might be preferable.
|
||||||
|
|
||||||
|
|
||||||
\membersection{Customization}\label{wxcmdlineparsercustomization}
|
\membersection{Customization}\label{wxcmdlineparsercustomization}
|
||||||
|
|
||||||
wxCmdLineParser has several global options which may be changed by the
|
wxCmdLineParser has several global options which may be changed by the
|
||||||
@@ -205,6 +207,7 @@ Finally, \helpref{SetLogo}{wxcmdlineparsersetlogo} can be used to show some
|
|||||||
application-specific text before the explanation given by
|
application-specific text before the explanation given by
|
||||||
\helpref{Usage}{wxcmdlineparserusage} function.
|
\helpref{Usage}{wxcmdlineparserusage} function.
|
||||||
|
|
||||||
|
|
||||||
\membersection{Parsing command line}\label{wxcmdlineparserparsing}
|
\membersection{Parsing command line}\label{wxcmdlineparserparsing}
|
||||||
|
|
||||||
After the command line description was constructed and the desired options were
|
After the command line description was constructed and the desired options were
|
||||||
@@ -217,6 +220,7 @@ command line parsing.
|
|||||||
In the latter case, the appropriate error message and usage information are
|
In the latter case, the appropriate error message and usage information are
|
||||||
logged by wxCmdLineParser itself using the standard wxWidgets logging functions.
|
logged by wxCmdLineParser itself using the standard wxWidgets logging functions.
|
||||||
|
|
||||||
|
|
||||||
\membersection{Getting results}\label{wxcmdlineparsergettingresults}
|
\membersection{Getting results}\label{wxcmdlineparsergettingresults}
|
||||||
|
|
||||||
After calling \helpref{Parse}{wxcmdlineparserparse} (and if it returned $0$),
|
After calling \helpref{Parse}{wxcmdlineparserparse} (and if it returned $0$),
|
||||||
@@ -237,6 +241,7 @@ command line or false if they were not specified.
|
|||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserdef}
|
\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserdef}
|
||||||
|
|
||||||
\func{}{wxCmdLineParser}{\void}
|
\func{}{wxCmdLineParser}{\void}
|
||||||
@@ -244,14 +249,23 @@ command line or false if they were not specified.
|
|||||||
Default constructor. You must use
|
Default constructor. You must use
|
||||||
\helpref{SetCmdLine}{wxcmdlineparsersetcmdlineargc} later.
|
\helpref{SetCmdLine}{wxcmdlineparsersetcmdlineargc} later.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserargc}
|
\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserargc}
|
||||||
|
|
||||||
\func{}{wxCmdLineParser}{\param{int }{argc}, \param{char** }{argv}}
|
\func{}{wxCmdLineParser}{\param{int }{argc}, \param{char** }{argv}}
|
||||||
|
|
||||||
|
\func{}{wxCmdLineParser}{\param{int }{argc}, \param{wchar\_t** }{argv}}
|
||||||
|
|
||||||
Constructor specifies the command line to parse. This is the traditional
|
Constructor specifies the command line to parse. This is the traditional
|
||||||
(Unix) command line format. The parameters {\it argc} and {\it argv} have the
|
(Unix) command line format. The parameters {\it argc} and {\it argv} have the
|
||||||
same meaning as for {\tt main()} function.
|
same meaning as for {\tt main()} function.
|
||||||
|
|
||||||
|
The second overloaded constructor is only available in Unicode build. The
|
||||||
|
first one is available in both ANSI and Unicode modes because under some
|
||||||
|
platforms the command line arguments are passed as ASCII strings even to
|
||||||
|
Unicode programs.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserstr}
|
\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserstr}
|
||||||
|
|
||||||
\func{}{wxCmdLineParser}{\param{const wxString\& }{cmdline}}
|
\func{}{wxCmdLineParser}{\param{const wxString\& }{cmdline}}
|
||||||
@@ -260,6 +274,7 @@ Constructor specifies the command line to parse in Windows format. The parameter
|
|||||||
{\it cmdline} has the same meaning as the corresponding parameter of
|
{\it cmdline} has the same meaning as the corresponding parameter of
|
||||||
{\tt WinMain()}.
|
{\tt WinMain()}.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserdesc}
|
\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserdesc}
|
||||||
|
|
||||||
\func{}{wxCmdLineParser}{\param{const wxCmdLineEntryDesc* }{desc}}
|
\func{}{wxCmdLineParser}{\param{const wxCmdLineEntryDesc* }{desc}}
|
||||||
@@ -267,6 +282,7 @@ Constructor specifies the command line to parse in Windows format. The parameter
|
|||||||
Same as \helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserdef}, but also
|
Same as \helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserdef}, but also
|
||||||
specifies the \helpref{command line description}{wxcmdlineparsersetdesc}.
|
specifies the \helpref{command line description}{wxcmdlineparsersetdesc}.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserdescargc}
|
\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserdescargc}
|
||||||
|
|
||||||
\func{}{wxCmdLineParser}{\param{const wxCmdLineEntryDesc* }{desc}, \param{int }{argc}, \param{char** }{argv}}
|
\func{}{wxCmdLineParser}{\param{const wxCmdLineEntryDesc* }{desc}, \param{int }{argc}, \param{char** }{argv}}
|
||||||
@@ -274,6 +290,7 @@ specifies the \helpref{command line description}{wxcmdlineparsersetdesc}.
|
|||||||
Same as \helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserargc}, but also
|
Same as \helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserargc}, but also
|
||||||
specifies the \helpref{command line description}{wxcmdlineparsersetdesc}.
|
specifies the \helpref{command line description}{wxcmdlineparsersetdesc}.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserdescstr}
|
\membersection{wxCmdLineParser::wxCmdLineParser}\label{wxcmdlineparserwxcmdlineparserdescstr}
|
||||||
|
|
||||||
\func{}{wxCmdLineParser}{\param{const wxCmdLineEntryDesc* }{desc}, \param{const wxString\& }{cmdline}}
|
\func{}{wxCmdLineParser}{\param{const wxCmdLineEntryDesc* }{desc}, \param{const wxString\& }{cmdline}}
|
||||||
@@ -281,6 +298,7 @@ specifies the \helpref{command line description}{wxcmdlineparsersetdesc}.
|
|||||||
Same as \helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserstr}, but also
|
Same as \helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserstr}, but also
|
||||||
specifies the \helpref{command line description}{wxcmdlineparsersetdesc}.
|
specifies the \helpref{command line description}{wxcmdlineparsersetdesc}.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::ConvertStringToArgs}\label{wxcmdlineparserconvertstringtoargs}
|
\membersection{wxCmdLineParser::ConvertStringToArgs}\label{wxcmdlineparserconvertstringtoargs}
|
||||||
|
|
||||||
\func{static wxArrayString}{ConvertStringToArgs}{\param{const wxChar }{*cmdline}}
|
\func{static wxArrayString}{ConvertStringToArgs}{\param{const wxChar }{*cmdline}}
|
||||||
@@ -289,16 +307,21 @@ 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
|
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.
|
the white space and the back slashes can be used to quote the quotes.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::SetCmdLine}\label{wxcmdlineparsersetcmdlineargc}
|
\membersection{wxCmdLineParser::SetCmdLine}\label{wxcmdlineparsersetcmdlineargc}
|
||||||
|
|
||||||
\func{void}{SetCmdLine}{\param{int }{argc}, \param{char** }{argv}}
|
\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.
|
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}
|
\wxheading{See also}
|
||||||
|
|
||||||
\helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserargc}
|
\helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserargc}
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::SetCmdLine}\label{wxcmdlineparsersetcmdlinestr}
|
\membersection{wxCmdLineParser::SetCmdLine}\label{wxcmdlineparsersetcmdlinestr}
|
||||||
|
|
||||||
\func{void}{SetCmdLine}{\param{const wxString\& }{cmdline}}
|
\func{void}{SetCmdLine}{\param{const wxString\& }{cmdline}}
|
||||||
@@ -309,6 +332,7 @@ Set command line to parse after using one of the constructors which don't do it.
|
|||||||
|
|
||||||
\helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserstr}
|
\helpref{wxCmdLineParser}{wxcmdlineparserwxcmdlineparserstr}
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::\destruct{wxCmdLineParser}}\label{wxcmdlineparserdtor}
|
\membersection{wxCmdLineParser::\destruct{wxCmdLineParser}}\label{wxcmdlineparserdtor}
|
||||||
|
|
||||||
\func{}{\destruct{wxCmdLineParser}}{\void}
|
\func{}{\destruct{wxCmdLineParser}}{\void}
|
||||||
@@ -317,6 +341,7 @@ Frees resources allocated by the object.
|
|||||||
|
|
||||||
{\bf NB:} destructor is not virtual, don't use this class polymorphically.
|
{\bf NB:} destructor is not virtual, don't use this class polymorphically.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::SetSwitchChars}\label{wxcmdlineparsersetswitchchars}
|
\membersection{wxCmdLineParser::SetSwitchChars}\label{wxcmdlineparsersetswitchchars}
|
||||||
|
|
||||||
\func{void}{SetSwitchChars}{\param{const wxString\& }{switchChars}}
|
\func{void}{SetSwitchChars}{\param{const wxString\& }{switchChars}}
|
||||||
@@ -324,6 +349,7 @@ Frees resources allocated by the object.
|
|||||||
{\it switchChars} contains all characters with which an option or switch may
|
{\it switchChars} contains all characters with which an option or switch may
|
||||||
start. Default is {\tt "-"} for Unix, {\tt "-/"} for Windows.
|
start. Default is {\tt "-"} for Unix, {\tt "-/"} for Windows.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::EnableLongOptions}\label{wxcmdlineparserenablelongoptions}
|
\membersection{wxCmdLineParser::EnableLongOptions}\label{wxcmdlineparserenablelongoptions}
|
||||||
|
|
||||||
\func{void}{EnableLongOptions}{\param{bool }{enable = true}}
|
\func{void}{EnableLongOptions}{\param{bool }{enable = true}}
|
||||||
@@ -337,12 +363,14 @@ them.
|
|||||||
|
|
||||||
\helpref{Customization}{wxcmdlineparsercustomization} and \helpref{AreLongOptionsEnabled}{wxcmdlineparserarelongoptionsenabled}
|
\helpref{Customization}{wxcmdlineparsercustomization} and \helpref{AreLongOptionsEnabled}{wxcmdlineparserarelongoptionsenabled}
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::DisableLongOptions}\label{wxcmdlineparserdisablelongoptions}
|
\membersection{wxCmdLineParser::DisableLongOptions}\label{wxcmdlineparserdisablelongoptions}
|
||||||
|
|
||||||
\func{void}{DisableLongOptions}{\void}
|
\func{void}{DisableLongOptions}{\void}
|
||||||
|
|
||||||
Identical to \helpref{EnableLongOptions(false)}{wxcmdlineparserenablelongoptions}.
|
Identical to \helpref{EnableLongOptions(false)}{wxcmdlineparserenablelongoptions}.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::AreLongOptionsEnabled}\label{wxcmdlineparserarelongoptionsenabled}
|
\membersection{wxCmdLineParser::AreLongOptionsEnabled}\label{wxcmdlineparserarelongoptionsenabled}
|
||||||
|
|
||||||
\func{bool}{AreLongOptionsEnabled}{\void}
|
\func{bool}{AreLongOptionsEnabled}{\void}
|
||||||
@@ -353,6 +381,7 @@ Returns true if long options are enabled, otherwise false.
|
|||||||
|
|
||||||
\helpref{EnableLongOptions}{wxcmdlineparserenablelongoptions}
|
\helpref{EnableLongOptions}{wxcmdlineparserenablelongoptions}
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::SetLogo}\label{wxcmdlineparsersetlogo}
|
\membersection{wxCmdLineParser::SetLogo}\label{wxcmdlineparsersetlogo}
|
||||||
|
|
||||||
\func{void}{SetLogo}{\param{const wxString\& }{logo}}
|
\func{void}{SetLogo}{\param{const wxString\& }{logo}}
|
||||||
@@ -360,6 +389,7 @@ Returns true if long options are enabled, otherwise false.
|
|||||||
{\it logo} is some extra text which will be shown by
|
{\it logo} is some extra text which will be shown by
|
||||||
\helpref{Usage}{wxcmdlineparserusage} method.
|
\helpref{Usage}{wxcmdlineparserusage} method.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::SetDesc}\label{wxcmdlineparsersetdesc}
|
\membersection{wxCmdLineParser::SetDesc}\label{wxcmdlineparsersetdesc}
|
||||||
|
|
||||||
\func{void}{SetDesc}{\param{const wxCmdLineEntryDesc* }{desc}}
|
\func{void}{SetDesc}{\param{const wxCmdLineEntryDesc* }{desc}}
|
||||||
@@ -391,6 +421,7 @@ wxCmdLineParser parser;
|
|||||||
parser.SetDesc(cmdLineDesc);
|
parser.SetDesc(cmdLineDesc);
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::AddSwitch}\label{wxcmdlineparseraddswitch}
|
\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}}
|
\func{void}{AddSwitch}{\param{const wxString\& }{name}, \param{const wxString\& }{lng = wxEmptyString}, \param{const wxString\& }{desc = wxEmptyString}, \param{int }{flags = 0}}
|
||||||
@@ -399,6 +430,7 @@ Add a switch {\it name} with an optional long name {\it lng} (no long name if it
|
|||||||
is empty, which is default), description {\it desc} and flags {\it flags} to the
|
is empty, which is default), description {\it desc} and flags {\it flags} to the
|
||||||
command line description.
|
command line description.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::AddOption}\label{wxcmdlineparseraddoption}
|
\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}}
|
\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}}
|
||||||
@@ -407,12 +439,14 @@ Add an option {\it name} with an optional long name {\it lng} (no long name if
|
|||||||
it is empty, which is default) taking a value of the given type (string by
|
it is empty, which is default) taking a value of the given type (string by
|
||||||
default) to the command line description.
|
default) to the command line description.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::AddParam}\label{wxcmdlineparseraddparam}
|
\membersection{wxCmdLineParser::AddParam}\label{wxcmdlineparseraddparam}
|
||||||
|
|
||||||
\func{void}{AddParam}{\param{const wxString\& }{desc = wxEmptyString}, \param{wxCmdLineParamType }{type = wxCMD\_LINE\_VAL\_STRING}, \param{int }{flags = 0}}
|
\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.
|
Add a parameter of the given {\it type} to the command line description.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::Parse}\label{wxcmdlineparserparse}
|
\membersection{wxCmdLineParser::Parse}\label{wxcmdlineparserparse}
|
||||||
|
|
||||||
\func{int}{Parse}{\param{bool }{giveUsage = {\tt true}}}
|
\func{int}{Parse}{\param{bool }{giveUsage = {\tt true}}}
|
||||||
@@ -429,6 +463,7 @@ requested. If {\tt false}, only error messages about possible syntax errors
|
|||||||
are given, use \helpref{Usage}{wxcmdlineparserusage} to show the usage message
|
are given, use \helpref{Usage}{wxcmdlineparserusage} to show the usage message
|
||||||
from the caller if needed.}
|
from the caller if needed.}
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::Usage}\label{wxcmdlineparserusage}
|
\membersection{wxCmdLineParser::Usage}\label{wxcmdlineparserusage}
|
||||||
|
|
||||||
\func{void}{Usage}{\void}
|
\func{void}{Usage}{\void}
|
||||||
@@ -441,12 +476,14 @@ will not be helpful to the user unless the descriptions were indeed specified.
|
|||||||
|
|
||||||
\helpref{SetLogo}{wxcmdlineparsersetlogo}
|
\helpref{SetLogo}{wxcmdlineparsersetlogo}
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::Found}\label{wxcmdlineparserfoundswitch}
|
\membersection{wxCmdLineParser::Found}\label{wxcmdlineparserfoundswitch}
|
||||||
|
|
||||||
\constfunc{bool}{Found}{\param{const wxString\& }{name}}
|
\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}
|
\membersection{wxCmdLineParser::Found}\label{wxcmdlineparserfoundstringoption}
|
||||||
|
|
||||||
\constfunc{bool}{Found}{\param{const wxString\& }{name}, \param{wxString* }{value}}
|
\constfunc{bool}{Found}{\param{const wxString\& }{name}, \param{wxString* }{value}}
|
||||||
@@ -454,6 +491,7 @@ Returns true if the given switch was found, false otherwise.
|
|||||||
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).
|
value in the provided pointer (which should not be NULL).
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::Found}\label{wxcmdlineparserfoundintoption}
|
\membersection{wxCmdLineParser::Found}\label{wxcmdlineparserfoundintoption}
|
||||||
|
|
||||||
\constfunc{bool}{Found}{\param{const wxString\& }{name}, \param{long* }{value}}
|
\constfunc{bool}{Found}{\param{const wxString\& }{name}, \param{long* }{value}}
|
||||||
@@ -461,6 +499,7 @@ value in the provided pointer (which should not be NULL).
|
|||||||
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).
|
the value in the provided pointer (which should not be NULL).
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::Found}\label{wxcmdlineparserfounddateoption}
|
\membersection{wxCmdLineParser::Found}\label{wxcmdlineparserfounddateoption}
|
||||||
|
|
||||||
\constfunc{bool}{Found}{\param{const wxString\& }{name}, \param{wxDateTime* }{value}}
|
\constfunc{bool}{Found}{\param{const wxString\& }{name}, \param{wxDateTime* }{value}}
|
||||||
@@ -468,6 +507,7 @@ the value in the provided pointer (which should not be NULL).
|
|||||||
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).
|
value in the provided pointer (which should not be NULL).
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::GetParamCount}\label{wxcmdlineparsergetparamcount}
|
\membersection{wxCmdLineParser::GetParamCount}\label{wxcmdlineparsergetparamcount}
|
||||||
|
|
||||||
\constfunc{size\_t}{GetParamCount}{\void}
|
\constfunc{size\_t}{GetParamCount}{\void}
|
||||||
@@ -475,6 +515,7 @@ value in the provided pointer (which should not be NULL).
|
|||||||
Returns the number of parameters found. This function makes sense mostly if you
|
Returns the number of parameters found. This function makes sense mostly if you
|
||||||
had used {\tt wxCMD\_LINE\_PARAM\_MULTIPLE} flag.
|
had used {\tt wxCMD\_LINE\_PARAM\_MULTIPLE} flag.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxCmdLineParser::GetParam}\label{wxcmdlineparsergetparam}
|
\membersection{wxCmdLineParser::GetParam}\label{wxcmdlineparsergetparam}
|
||||||
|
|
||||||
\constfunc{wxString}{GetParam}{\param{size\_t }{n = 0u}}
|
\constfunc{wxString}{GetParam}{\param{size\_t }{n = 0u}}
|
||||||
|
@@ -101,20 +101,30 @@ public:
|
|||||||
|
|
||||||
// default ctor or ctor giving the cmd line in either Unix or Win form
|
// default ctor or ctor giving the cmd line in either Unix or Win form
|
||||||
wxCmdLineParser() { Init(); }
|
wxCmdLineParser() { Init(); }
|
||||||
|
wxCmdLineParser(int argc, char **argv) { Init(); SetCmdLine(argc, argv); }
|
||||||
|
#if wxUSE_UNICODE
|
||||||
wxCmdLineParser(int argc, wxChar **argv) { Init(); SetCmdLine(argc, argv); }
|
wxCmdLineParser(int argc, wxChar **argv) { Init(); SetCmdLine(argc, argv); }
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
wxCmdLineParser(const wxString& cmdline) { Init(); SetCmdLine(cmdline); }
|
wxCmdLineParser(const wxString& cmdline) { Init(); SetCmdLine(cmdline); }
|
||||||
|
|
||||||
// the same as above, but also gives the cmd line description - otherwise,
|
// the same as above, but also gives the cmd line description - otherwise,
|
||||||
// use AddXXX() later
|
// use AddXXX() later
|
||||||
wxCmdLineParser(const wxCmdLineEntryDesc *desc)
|
wxCmdLineParser(const wxCmdLineEntryDesc *desc)
|
||||||
{ Init(); SetDesc(desc); }
|
{ Init(); SetDesc(desc); }
|
||||||
|
wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, char **argv)
|
||||||
|
{ Init(); SetCmdLine(argc, argv); SetDesc(desc); }
|
||||||
|
#if wxUSE_UNICODE
|
||||||
wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, wxChar **argv)
|
wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, wxChar **argv)
|
||||||
{ Init(); SetCmdLine(argc, argv); SetDesc(desc); }
|
{ Init(); SetCmdLine(argc, argv); SetDesc(desc); }
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
wxCmdLineParser(const wxCmdLineEntryDesc *desc, const wxString& cmdline)
|
wxCmdLineParser(const wxCmdLineEntryDesc *desc, const wxString& cmdline)
|
||||||
{ Init(); SetCmdLine(cmdline); SetDesc(desc); }
|
{ Init(); SetCmdLine(cmdline); SetDesc(desc); }
|
||||||
|
|
||||||
// set cmd line to parse after using one of the ctors which don't do it
|
// set cmd line to parse after using one of the ctors which don't do it
|
||||||
|
void SetCmdLine(int argc, char **argv);
|
||||||
|
#if wxUSE_UNICODE
|
||||||
void SetCmdLine(int argc, wxChar **argv);
|
void SetCmdLine(int argc, wxChar **argv);
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
void SetCmdLine(const wxString& cmdline);
|
void SetCmdLine(const wxString& cmdline);
|
||||||
|
|
||||||
// not virtual, don't use this class polymorphically
|
// not virtual, don't use this class polymorphically
|
||||||
|
@@ -189,7 +189,10 @@ struct wxCmdLineParserData
|
|||||||
|
|
||||||
// methods
|
// methods
|
||||||
wxCmdLineParserData();
|
wxCmdLineParserData();
|
||||||
|
void SetArguments(int argc, char **argv);
|
||||||
|
#if wxUSE_UNICODE
|
||||||
void SetArguments(int argc, wxChar **argv);
|
void SetArguments(int argc, wxChar **argv);
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
void SetArguments(const wxString& cmdline);
|
void SetArguments(const wxString& cmdline);
|
||||||
|
|
||||||
int FindOption(const wxString& name);
|
int FindOption(const wxString& name);
|
||||||
@@ -214,6 +217,18 @@ wxCmdLineParserData::wxCmdLineParserData()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxCmdLineParserData::SetArguments(int argc, char **argv)
|
||||||
|
{
|
||||||
|
m_arguments.clear();
|
||||||
|
|
||||||
|
for ( int n = 0; n < argc; n++ )
|
||||||
|
{
|
||||||
|
m_arguments.push_back(wxString::FromAscii(argv[n]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
|
||||||
void wxCmdLineParserData::SetArguments(int argc, wxChar **argv)
|
void wxCmdLineParserData::SetArguments(int argc, wxChar **argv)
|
||||||
{
|
{
|
||||||
m_arguments.clear();
|
m_arguments.clear();
|
||||||
@@ -224,6 +239,8 @@ void wxCmdLineParserData::SetArguments(int argc, wxChar **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
|
|
||||||
void wxCmdLineParserData::SetArguments(const wxString& cmdLine)
|
void wxCmdLineParserData::SetArguments(const wxString& cmdLine)
|
||||||
{
|
{
|
||||||
m_arguments.clear();
|
m_arguments.clear();
|
||||||
@@ -277,11 +294,20 @@ void wxCmdLineParser::Init()
|
|||||||
m_data = new wxCmdLineParserData;
|
m_data = new wxCmdLineParserData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxCmdLineParser::SetCmdLine(int argc, char **argv)
|
||||||
|
{
|
||||||
|
m_data->SetArguments(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
|
||||||
void wxCmdLineParser::SetCmdLine(int argc, wxChar **argv)
|
void wxCmdLineParser::SetCmdLine(int argc, wxChar **argv)
|
||||||
{
|
{
|
||||||
m_data->SetArguments(argc, argv);
|
m_data->SetArguments(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
|
|
||||||
void wxCmdLineParser::SetCmdLine(const wxString& cmdline)
|
void wxCmdLineParser::SetCmdLine(const wxString& cmdline)
|
||||||
{
|
{
|
||||||
m_data->SetArguments(cmdline);
|
m_data->SetArguments(cmdline);
|
||||||
|
Reference in New Issue
Block a user