本文整理汇总了C++中SList::GetHeadPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ SList::GetHeadPosition方法的具体用法?C++ SList::GetHeadPosition怎么用?C++ SList::GetHeadPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SList
的用法示例。
在下文中一共展示了SList::GetHeadPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnNextFrame
void SwndContainerImpl::OnNextFrame()
{
if(!IsVisible(TRUE)) return;
SList<ITimelineHandler*> lstCopy;
CopyList(m_lstTimelineHandler,lstCopy);
SPOSITION pos=lstCopy.GetHeadPosition();
while(pos)
{
ITimelineHandler * pHandler=lstCopy.GetNext(pos);
pHandler->OnNextFrame();
}
}
示例2: ExecutePendingEvents
void SNotifyCenter::ExecutePendingEvents()
{
SASSERT(m_dwMainTrdID == GetCurrentThreadId());
SList<EventArgs*> *pEvtList = NULL;
{
SAutoLock lock(m_cs);
if(m_evtPending)
{
pEvtList = m_evtPending;
m_evtPending = NULL;
}
}
if(!pEvtList) return;
SPOSITION pos = pEvtList->GetHeadPosition();
while(pos)
{
EventArgs *e = pEvtList->GetNext(pos);
OnFireEvent(e);
e->Release();
}
delete pEvtList;
}
示例3: OnBtnGo
void CCodeLineCounterHandler::OnBtnGo()
{
if(m_strDir.IsEmpty())
{
SMessageBox(m_pPageRoot->GetContainer()->GetHostHwnd(),_T("没有指定扫描目录"),_T("错误"),MB_OK|MB_ICONSTOP);
return;
}
SStringT strTypes = m_pPageRoot->FindChildByName(L"edit_filetypes")->GetWindowText();
SStringWList lstTypes;
SplitString(S_CT2W(strTypes),L';',lstTypes);
CODECFGMAP cfg;
for(UINT i=0;i<lstTypes.GetCount();i++)
{
CODECFGMAP::CPair *pPair = m_mapCodeCfg.Lookup(lstTypes[i]);
if(!pPair) continue;
cfg[lstTypes[i]] = pPair->m_value;
}
if(cfg.IsEmpty())
{
SMessageBox(m_pPageRoot->GetContainer()->GetHostHwnd(),_T("没有指定文件类型或者类型无效"),_T("错误"),MB_OK|MB_ICONSTOP);
return;
}
//获得文件列表,计每个目标文件的文件大小
HSTREEITEM hRoot = m_pDirTree->GetRootItem();
SList<FILEINFO> lstFileInfo;
int nDirs = 1;
DWORD szAll = EnumFileInfo(cfg,m_strDir,hRoot,lstFileInfo,nDirs);
if(lstFileInfo.GetCount() == 0)
{
SMessageBox(m_pPageRoot->GetContainer()->GetHostHwnd(),_T("指定的目录下没有找到满足条件的文件类型"),_T("提示"),MB_OK|MB_ICONINFORMATION);
return;
}
//SWindow *pPageResult = m_pPageRoot->FindChildByName(L"page_dir");
SSplitWnd_Row *pSplitTree = m_pPageRoot->FindChildByName2<SSplitWnd_Row>(L"split_tree");
pSplitTree->ShowPane(1);
SProgress *pProgBar = pSplitTree->FindChildByName2<SProgress>(L"prog_run");
pProgBar->SetRange(0,szAll);
pProgBar->SetValue(0);
CLineInfo lineInfoAll;
SMap<SStringW,CLineInfo> mapLineInfo;
for(UINT i=0;i<lstTypes.GetCount();i++)
{
mapLineInfo[lstTypes[i]] = CLineInfo();
}
//统计代码行
DWORD dwProg = 0;
SPOSITION pos = lstFileInfo.GetHeadPosition();
while(pos)
{
FILEINFO fi = lstFileInfo.GetNext(pos);
CLineInfo lineInfo;
CountCodeLines(S_CW2T(fi.strFileName),fi.cfg,lineInfo.nCodeLines,lineInfo.nRemarkLines,lineInfo.nBlankLines);
lineInfoAll += lineInfo;
mapLineInfo[fi.cfg.strExt] += lineInfo;
dwProg += fi.dwSize;
pProgBar->SetValue(dwProg);
pProgBar->UpdateWindow();
}
pSplitTree->HidePane(1);
STabCtrl *pTab = m_pPageRoot->FindChildByName2<STabCtrl>(L"tab_codeline");
pTab->SetCurSel(1);
SWindow *pWndRes = pTab->GetPage(_T("page_result"),FALSE);
pWndRes->FindChildByName(L"txt_folders")->SetWindowText(SStringT().Format(_T("%d"),nDirs));
pWndRes->FindChildByName(L"txt_files")->SetWindowText(SStringT().Format(_T("%d"),lstFileInfo.GetCount()));
pWndRes->FindChildByName(L"txt_codelines")->SetWindowText(SStringT().Format(_T("%d"),lineInfoAll.nCodeLines));
pWndRes->FindChildByName(L"txt_blanklines")->SetWindowText(SStringT().Format(_T("%d"),lineInfoAll.nBlankLines));
pWndRes->FindChildByName(L"txt_remarklines")->SetWindowText(SStringT().Format(_T("%d"),lineInfoAll.nRemarkLines));
SListCtrl *plstReport = pWndRes->FindChildByName2<SListCtrl>(L"lst_linecounter_report");
plstReport->DeleteAllItems();
for(UINT i=0;i<lstTypes.GetCount();i++)
{
CCodeConfig codeCfg = cfg[lstTypes[i]];
CLineInfo lineInfo = mapLineInfo[lstTypes[i]];
plstReport->InsertItem(i,S_CW2T(codeCfg.strType));
plstReport->SetSubItemText(i,1,S_CW2T(codeCfg.strExt));
plstReport->SetSubItemText(i,2,SStringT().Format(_T("%d"),lineInfo.nCodeLines));
plstReport->SetSubItemText(i,3,SStringT().Format(_T("%d"),lineInfo.nBlankLines));
plstReport->SetSubItemText(i,4,SStringT().Format(_T("%d"),lineInfo.nRemarkLines));
}
}