Added --use-stl to cnfigure, wxUSE_STL to setup0.h
Moved wx/datetime.inl contents to wx/datetime.h and removed inline redefinition hack. Implemented STL-like interface on top of wxList/wxArray, when wxUSE_STL=0. Implemented wxList-like and wxArray interfaces on top of std::list and std::vector, when wxUSE_STL=1. Added arrstr.h, moved wxArrayString declaration there; string.h #includes arrstr.h only if WXWIN_COMPATIBILITY_2_4 is enabled. Added WX_CLEAR_HASH_MAP, WX_CLEAR_HASH_TABLE, WX_CLEAR_LIST macros, to clear a wxHashMap, wxHashTable, wxList containing pointers: deletes pointers and makes container zero-sized. When wxUSE_STL=1, wxStringList works like a std::list<wxString>. Made wxBase compile when wxUSE_STL=1. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -216,19 +216,19 @@ wxCmdLineParserData::wxCmdLineParserData()
|
||||
|
||||
void wxCmdLineParserData::SetArguments(int argc, wxChar **argv)
|
||||
{
|
||||
m_arguments.Empty();
|
||||
m_arguments.clear();
|
||||
|
||||
for ( int n = 0; n < argc; n++ )
|
||||
{
|
||||
m_arguments.Add(argv[n]);
|
||||
m_arguments.push_back(argv[n]);
|
||||
}
|
||||
}
|
||||
|
||||
void wxCmdLineParserData::SetArguments(const wxString& cmdLine)
|
||||
{
|
||||
m_arguments.Empty();
|
||||
m_arguments.clear();
|
||||
|
||||
m_arguments.Add(wxTheApp->GetAppName());
|
||||
m_arguments.push_back(wxTheApp->GetAppName());
|
||||
|
||||
wxArrayString args = wxCmdLineParser::ConvertStringToArgs(cmdLine);
|
||||
|
||||
@@ -488,7 +488,7 @@ bool wxCmdLineParser::Found(const wxString& name, wxDateTime *value) const
|
||||
|
||||
size_t wxCmdLineParser::GetParamCount() const
|
||||
{
|
||||
return m_data->m_parameters.GetCount();
|
||||
return m_data->m_parameters.size();
|
||||
}
|
||||
|
||||
wxString wxCmdLineParser::GetParam(size_t n) const
|
||||
@@ -529,7 +529,7 @@ int wxCmdLineParser::Parse(bool showUsage)
|
||||
|
||||
// parse everything
|
||||
wxString arg;
|
||||
size_t count = m_data->m_arguments.GetCount();
|
||||
size_t count = m_data->m_arguments.size();
|
||||
for ( size_t n = 1; ok && (n < count); n++ ) // 0 is program name
|
||||
{
|
||||
arg = m_data->m_arguments[n];
|
||||
@@ -632,7 +632,8 @@ int wxCmdLineParser::Parse(bool showUsage)
|
||||
wxString arg2 = arg[0u];
|
||||
arg2 += arg.Mid(len + 1); // +1 for leading '-'
|
||||
|
||||
m_data->m_arguments.Insert(arg2, n + 1);
|
||||
m_data->m_arguments.insert
|
||||
(m_data->m_arguments.begin() + n + 1, arg2);
|
||||
count++;
|
||||
}
|
||||
//else: it's our value, we'll deal with it below
|
||||
@@ -779,7 +780,7 @@ int wxCmdLineParser::Parse(bool showUsage)
|
||||
|
||||
// TODO check the param type
|
||||
|
||||
m_data->m_parameters.Add(arg);
|
||||
m_data->m_parameters.push_back(arg);
|
||||
|
||||
if ( !(param.flags & wxCMD_LINE_PARAM_MULTIPLE) )
|
||||
{
|
||||
@@ -905,7 +906,7 @@ wxString wxCmdLineParser::GetUsageString()
|
||||
wxString appname = wxTheApp->GetAppName();
|
||||
if ( !appname )
|
||||
{
|
||||
wxCHECK_MSG( !m_data->m_arguments.IsEmpty(), wxEmptyString,
|
||||
wxCHECK_MSG( m_data->m_arguments.size() != 0, wxEmptyString,
|
||||
_T("no program name") );
|
||||
|
||||
appname = wxFileNameFromPath(m_data->m_arguments[0]);
|
||||
@@ -989,8 +990,8 @@ wxString wxCmdLineParser::GetUsageString()
|
||||
usage << _T(']');
|
||||
}
|
||||
|
||||
namesOptions.Add(option);
|
||||
descOptions.Add(opt.description);
|
||||
namesOptions.push_back(option);
|
||||
descOptions.push_back(opt.description);
|
||||
}
|
||||
|
||||
count = m_data->m_paramDesc.GetCount();
|
||||
@@ -1021,7 +1022,7 @@ wxString wxCmdLineParser::GetUsageString()
|
||||
|
||||
// now construct the detailed help message
|
||||
size_t len, lenMax = 0;
|
||||
count = namesOptions.GetCount();
|
||||
count = namesOptions.size();
|
||||
for ( n = 0; n < count; n++ )
|
||||
{
|
||||
len = namesOptions[n].length();
|
||||
@@ -1236,7 +1237,7 @@ wxArrayString wxCmdLineParser::ConvertStringToArgs(const wxChar *p)
|
||||
}
|
||||
}
|
||||
|
||||
args.Add(arg);
|
||||
args.push_back(arg);
|
||||
}
|
||||
|
||||
return args;
|
||||
|
Reference in New Issue
Block a user