reverted the change of wxCmdLineEntryDesc fields to wxString as this doesn't compile with VC6; make them const char * instead
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,10 +24,13 @@ changes:
|
|||||||
|
|
||||||
b) Passing NULL as argument: as NULL can't be unambiguously converted to
|
b) Passing NULL as argument: as NULL can't be unambiguously converted to
|
||||||
wxString, in many cases code using it won't compile any more and NULL
|
wxString, in many cases code using it won't compile any more and NULL
|
||||||
should be replaced with an empty string. The same issue also applies to
|
should be replaced with an empty string.
|
||||||
the structure fields which used to contain "const wxChar *" pointers (such
|
|
||||||
as wxCmdLineEntryDesc::shortName, longName and description fields) and are
|
|
||||||
now wxStrings: empty strings should be assigned to them instead of NULL.
|
- Some structure fields which used to be of type "const wxChar *" (such as
|
||||||
|
wxCmdLineEntryDesc::shortName, longName and description fields) are now of
|
||||||
|
type "const char *", you need to remove wxT() or _T() around the values used
|
||||||
|
to initialize them (which should normally always be ASCII).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -64,13 +64,17 @@ enum wxCmdLineEntryType
|
|||||||
struct wxCmdLineEntryDesc
|
struct wxCmdLineEntryDesc
|
||||||
{
|
{
|
||||||
wxCmdLineEntryType kind;
|
wxCmdLineEntryType kind;
|
||||||
wxString shortName;
|
const char *shortName;
|
||||||
wxString longName;
|
const char *longName;
|
||||||
wxString description;
|
const char *description;
|
||||||
wxCmdLineParamType type;
|
wxCmdLineParamType type;
|
||||||
int flags;
|
int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// the list of wxCmdLineEntryDesc objects should be terminated with this one
|
||||||
|
#define wxCMD_LINE_DESC_END \
|
||||||
|
{ wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_NONE, 0x0 }
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxCmdLineParser is a class for parsing command line.
|
// wxCmdLineParser is a class for parsing command line.
|
||||||
//
|
//
|
||||||
|
@@ -485,7 +485,7 @@ void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
|
|||||||
#if wxUSE_LOG
|
#if wxUSE_LOG
|
||||||
{
|
{
|
||||||
wxCMD_LINE_SWITCH,
|
wxCMD_LINE_SWITCH,
|
||||||
"",
|
NULL,
|
||||||
OPTION_VERBOSE,
|
OPTION_VERBOSE,
|
||||||
gettext_noop("generate verbose log messages"),
|
gettext_noop("generate verbose log messages"),
|
||||||
wxCMD_LINE_VAL_NONE,
|
wxCMD_LINE_VAL_NONE,
|
||||||
@@ -494,14 +494,7 @@ void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
|
|||||||
#endif // wxUSE_LOG
|
#endif // wxUSE_LOG
|
||||||
|
|
||||||
// terminator
|
// terminator
|
||||||
{
|
wxCMD_LINE_DESC_END
|
||||||
wxCMD_LINE_NONE,
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
wxCMD_LINE_VAL_NONE,
|
|
||||||
0x0
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
parser.SetDesc(cmdLineDesc);
|
parser.SetDesc(cmdLineDesc);
|
||||||
|
@@ -203,7 +203,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
|
|||||||
#ifdef __WXUNIVERSAL__
|
#ifdef __WXUNIVERSAL__
|
||||||
{
|
{
|
||||||
wxCMD_LINE_OPTION,
|
wxCMD_LINE_OPTION,
|
||||||
"",
|
NULL,
|
||||||
OPTION_THEME,
|
OPTION_THEME,
|
||||||
gettext_noop("specify the theme to use"),
|
gettext_noop("specify the theme to use"),
|
||||||
wxCMD_LINE_VAL_STRING,
|
wxCMD_LINE_VAL_STRING,
|
||||||
@@ -217,7 +217,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
|
|||||||
// and not mgl/app.cpp
|
// and not mgl/app.cpp
|
||||||
{
|
{
|
||||||
wxCMD_LINE_OPTION,
|
wxCMD_LINE_OPTION,
|
||||||
"",
|
NULL,
|
||||||
OPTION_MODE,
|
OPTION_MODE,
|
||||||
gettext_noop("specify display mode to use (e.g. 640x480-16)"),
|
gettext_noop("specify display mode to use (e.g. 640x480-16)"),
|
||||||
wxCMD_LINE_VAL_STRING,
|
wxCMD_LINE_VAL_STRING,
|
||||||
@@ -226,14 +226,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
|
|||||||
#endif // __WXMGL__
|
#endif // __WXMGL__
|
||||||
|
|
||||||
// terminator
|
// terminator
|
||||||
{
|
wxCMD_LINE_DESC_END
|
||||||
wxCMD_LINE_NONE,
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
wxCMD_LINE_VAL_NONE,
|
|
||||||
0x0
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
parser.SetDesc(cmdLineGUIDesc);
|
parser.SetDesc(cmdLineGUIDesc);
|
||||||
|
@@ -253,11 +253,11 @@ int XmlResApp::OnRun()
|
|||||||
#if 0 // not yet implemented
|
#if 0 // not yet implemented
|
||||||
{ wxCMD_LINE_OPTION, _T("l"), _T("list-of-handlers"), _T("output list of necessary handlers to this file"), (wxCmdLineParamType)0, 0 },
|
{ wxCMD_LINE_OPTION, _T("l"), _T("list-of-handlers"), _T("output list of necessary handlers to this file"), (wxCmdLineParamType)0, 0 },
|
||||||
#endif
|
#endif
|
||||||
{ wxCMD_LINE_PARAM, "", "", _T("input file(s)"),
|
{ wxCMD_LINE_PARAM, NULL, NULL, _T("input file(s)"),
|
||||||
wxCMD_LINE_VAL_STRING,
|
wxCMD_LINE_VAL_STRING,
|
||||||
wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_OPTION_MANDATORY },
|
wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_OPTION_MANDATORY },
|
||||||
|
|
||||||
{ wxCMD_LINE_NONE, "", "", "", (wxCmdLineParamType)0, 0 }
|
wxCMD_LINE_DESC_END
|
||||||
};
|
};
|
||||||
|
|
||||||
wxCmdLineParser parser(cmdLineDesc, argc, argv);
|
wxCmdLineParser parser(cmdLineDesc, argc, argv);
|
||||||
|
Reference in New Issue
Block a user