本文整理汇总了C++中wxArrayInt::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ wxArrayInt::begin方法的具体用法?C++ wxArrayInt::begin怎么用?C++ wxArrayInt::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxArrayInt
的用法示例。
在下文中一共展示了wxArrayInt::begin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeWads
void WadListBox::removeWads(const wxArrayInt& indices) {
StringList newList;
for (size_t i = 0; i < m_wadFiles.size(); i++) {
if (std::find(indices.begin(), indices.end(), i) == indices.end())
newList.push_back(m_wadFiles[i]);
}
m_wadFiles = newList;
SetItemCount(m_wadFiles.size());
Refresh();
}
示例2: FindChanges
// returns all new dirs/files present in the immediate level of the dir
// pointed by watch.GetPath(). "new" means created between the last time
// the state of watch was computed and now
void FindChanges(wxFSWatchEntryKq& watch,
wxArrayString& changedFiles,
wxArrayInt& changedFlags)
{
wxFSWatchEntryKq::wxDirState old = watch.GetLastState();
watch.RefreshState();
wxFSWatchEntryKq::wxDirState curr = watch.GetLastState();
// iterate over old/curr file lists and compute changes
wxArrayString::iterator oit = old.files.begin();
wxArrayString::iterator cit = curr.files.begin();
for ( ; oit != old.files.end() && cit != curr.files.end(); )
{
if ( *cit == *oit )
{
++cit;
++oit;
}
else if ( *cit <= *oit )
{
changedFiles.push_back(*cit);
changedFlags.push_back(wxFSW_EVENT_CREATE);
++cit;
}
else // ( *cit > *oit )
{
changedFiles.push_back(*oit);
changedFlags.push_back(wxFSW_EVENT_DELETE);
++oit;
}
}
// border conditions
if ( oit == old.files.end() )
{
for ( ; cit != curr.files.end(); ++cit )
{
changedFiles.push_back( *cit );
changedFlags.push_back(wxFSW_EVENT_CREATE);
}
}
else if ( cit == curr.files.end() )
{
for ( ; oit != old.files.end(); ++oit )
{
changedFiles.push_back( *oit );
changedFlags.push_back(wxFSW_EVENT_DELETE);
}
}
wxASSERT( changedFiles.size() == changedFlags.size() );
#if 0
wxLogTrace(wxTRACE_FSWATCHER, "Changed files:");
wxArrayString::iterator it = changedFiles.begin();
wxArrayInt::iterator it2 = changedFlags.begin();
for ( ; it != changedFiles.end(); ++it, ++it2)
{
wxString action = (*it2 == wxFSW_EVENT_CREATE) ?
"created" : "deleted";
wxLogTrace(wxTRACE_FSWATCHER, wxString::Format("File: '%s' %s",
*it, action));
}
#endif
}