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
- should be replaced with an empty string. The same issue also applies to
- 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.
+ should be replaced with an empty string.
+
+
+- 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).
struct wxCmdLineEntryDesc
{
wxCmdLineEntryType kind;
- wxString shortName;
- wxString longName;
- wxString description;
+ const char *shortName;
+ const char *longName;
+ const char *description;
wxCmdLineParamType type;
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.
//
#if wxUSE_LOG
{
wxCMD_LINE_SWITCH,
- "",
+ NULL,
OPTION_VERBOSE,
gettext_noop("generate verbose log messages"),
wxCMD_LINE_VAL_NONE,
#endif // wxUSE_LOG
// terminator
- {
- wxCMD_LINE_NONE,
- "",
- "",
- "",
- wxCMD_LINE_VAL_NONE,
- 0x0
- }
+ wxCMD_LINE_DESC_END
};
parser.SetDesc(cmdLineDesc);
#ifdef __WXUNIVERSAL__
{
wxCMD_LINE_OPTION,
- "",
+ NULL,
OPTION_THEME,
gettext_noop("specify the theme to use"),
wxCMD_LINE_VAL_STRING,
// and not mgl/app.cpp
{
wxCMD_LINE_OPTION,
- "",
+ NULL,
OPTION_MODE,
gettext_noop("specify display mode to use (e.g. 640x480-16)"),
wxCMD_LINE_VAL_STRING,
#endif // __WXMGL__
// terminator
- {
- wxCMD_LINE_NONE,
- "",
- "",
- "",
- wxCMD_LINE_VAL_NONE,
- 0x0
- }
+ wxCMD_LINE_DESC_END
};
parser.SetDesc(cmdLineGUIDesc);
#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 },
#endif
- { wxCMD_LINE_PARAM, "", "", _T("input file(s)"),
+ { wxCMD_LINE_PARAM, NULL, NULL, _T("input file(s)"),
wxCMD_LINE_VAL_STRING,
wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_OPTION_MANDATORY },
- { wxCMD_LINE_NONE, "", "", "", (wxCmdLineParamType)0, 0 }
+ wxCMD_LINE_DESC_END
};
wxCmdLineParser parser(cmdLineDesc, argc, argv);