本文整理匯總了C++中CAtlList::RemoveTail方法的典型用法代碼示例。如果您正苦於以下問題:C++ CAtlList::RemoveTail方法的具體用法?C++ CAtlList::RemoveTail怎麽用?C++ CAtlList::RemoveTail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CAtlList
的用法示例。
在下文中一共展示了CAtlList::RemoveTail方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: OnLvnGetInfoTipList
void CFavoriteOrganizeDlg::OnLvnGetInfoTipList(NMHDR* pNMHDR, LRESULT* pResult)
{
LPNMLVGETINFOTIP pGetInfoTip = reinterpret_cast<LPNMLVGETINFOTIP>(pNMHDR);
CAtlList<CString> args;
ExplodeEsc(m_sl[m_tab.GetCurSel()].GetAt((POSITION)m_list.GetItemData(pGetInfoTip->iItem)), args, _T(';'));
CString path = args.RemoveTail();
// Relative to drive value is always third. If less args are available that means it is not included.
int rootLength = (args.GetCount() == 3 && args.RemoveTail() != _T("0")) ? CPath(path).SkipRoot() : 0;
StringCchCopy(pGetInfoTip->pszText, pGetInfoTip->cchTextMax, path.Mid(rootLength));
*pResult = 0;
}
示例2: Explode
void CShaderAutoCompleteDlg::OnLbnSelchangeList1()
{
::SendMessage(m_hToolTipWnd, TTM_TRACKACTIVATE, FALSE, (LPARAM)&m_ti);
int i = m_list.GetCurSel();
if (i < 0) {
return;
}
if (POSITION pos = (POSITION)m_list.GetItemData(i)) {
CString str, desc;
m_inst.GetNextAssoc(pos, str, desc);
CAtlList<CString> sl;
Explode(desc, sl, '|', 2);
if (sl.GetCount() != 2) {
return;
}
_tcscpy_s(m_ti.lpszText, _countof(m_text), sl.RemoveTail());
CRect r;
GetWindowRect(r);
::SendMessage(m_hToolTipWnd, TTM_UPDATETIPTEXT, 0, (LPARAM)&m_ti);
::SendMessage(m_hToolTipWnd, TTM_TRACKPOSITION, 0, (LPARAM)MAKELONG(r.left, r.bottom + 1));
::SendMessage(m_hToolTipWnd, TTM_TRACKACTIVATE, TRUE, (LPARAM)&m_ti);
}
}
示例3: ParseDirs
void ParseDirs(CAtlList<CString>& paths)
{
POSITION pos = paths.GetHeadPosition();
while (pos) {
POSITION prevPos = pos;
CString fn = paths.GetNext(pos);
// Try to follow link files that point to a directory
if (IsLinkFile(fn)) {
fn = ResolveLinkFile(fn);
}
if (IsDir(fn)) {
CAtlList<CString> subDirs;
RecurseAddDir(fn, subDirs);
// Add the subdirectories just after their parent
// so that the tree is not parsed multiple times
while (!subDirs.IsEmpty()) {
paths.InsertAfter(prevPos, subDirs.RemoveTail());
}
}
}
}
示例4: Dump
void SZYamlDocument::Dump(CString& strText, int nDumpIndent/* = SZYAML_DUMP_INDENT*/)
{
POSITION pos = m_YamlItemList.GetHeadPosition();
struct _KeyStackNode
{
_KeyStackNode()
: nIndent(0)
, nChildIndent(0)
, bIsList(FALSE)
{
}
int nIndent;
int nChildIndent;
CString strKey;
BOOL bIsList;
};
CAtlList<_KeyStackNode> listKeyStack;
int nLastIndent = -1;
BOOL bListItem = FALSE, bPrintThisLine = TRUE;
CString strLine;
strText = _T("");
while (pos)
{
_YamlItem &item = m_YamlItemList.GetAt(pos);
if (listKeyStack.IsEmpty())
bListItem = FALSE;
else
bListItem = listKeyStack.GetTail().bIsList;
if (item.nIndent == nLastIndent + 1)
{
_KeyStackNode &newkey = listKeyStack.GetAt(listKeyStack.AddTail());
POSITION posNext = _GetNextPos(pos, TRUE);
newkey.nIndent = item.nIndent;
newkey.strKey = item.node.Key();
newkey.bIsList = (posNext != NULL);
}
else if (item.nIndent == nLastIndent)
{
_KeyStackNode &newkey = listKeyStack.GetTail();
POSITION posNext = _GetNextPos(pos, TRUE);
newkey.nIndent = item.nIndent;
newkey.strKey = item.node.Key();
newkey.bIsList = (posNext != NULL);
}
else if (item.nIndent < nLastIndent)
{
for (nLastIndent -= item.nIndent; nLastIndent > 0; -- nLastIndent)
listKeyStack.RemoveTail();
if (listKeyStack.IsEmpty())
bPrintThisLine = TRUE;
else
{
_KeyStackNode &newkey = listKeyStack.GetTail();
newkey.nIndent = item.nIndent;
if (newkey.strKey != item.node.Key())
{
newkey.strKey = item.node.Key();
POSITION posNext = _GetNextPos(pos, TRUE);
newkey.bIsList = (posNext != NULL);
}
else
bPrintThisLine = !newkey.bIsList;
}
}
#ifdef _SZYAML_DEBUG_TRACE
{ // Trace Key Stack
kconsole::printf(_T(" "));
for (POSITION pos = listKeyStack.GetHeadPosition(); pos != NULL; listKeyStack.GetNext(pos))
{
_KeyStackNode key = listKeyStack.GetAt(pos);
kconsole::settextcolor(TRUE, TRUE, TRUE, FALSE);
kconsole::printf(_T("(%d, '%s', %d)"), key.nIndent, key.strKey, key.bIsList);
kconsole::settextcolor(TRUE, TRUE, TRUE, TRUE);
}
kconsole::printf(_T("\r\n"));
}
#endif
// 這裏對不確定長度的%s不使用Format,是因為MIN_CRT的格式化輸出限製長度為1024,見atlstr.h
// by bbcallen 2009-07-02
if (bPrintThisLine)
{
if (bListItem)
{
strLine.Format(
_T("%s-%s"),
CString(_T(' '), (item.nIndent - 1) * nDumpIndent),
CString(_T(' '), nDumpIndent - 1)
);
//.........這裏部分代碼省略.........
示例5: Load
//.........這裏部分代碼省略.........
#ifdef _SZYAML_DEBUG_TRACE
{ // Trace Key Stack
kconsole::printf(_T(" "));
for (POSITION pos = listKeyStack.GetHeadPosition(); pos != NULL; listKeyStack.GetNext(pos))
{
_KeyStackNode key = listKeyStack.GetAt(pos);
kconsole::printf(_T("(%d, '%s', %d)"), key.nChildIndent, key.strKey, key.bIsList);
}
kconsole::printf(_T("\r\n"));
}
#endif
}
strLine = strLine.Mid(nIndent);
if (strLine.IsEmpty())
continue;
while (!listKeyStack.IsEmpty())
{
_KeyStackNode &LastKey = listKeyStack.GetTail();
if (LastKey.nChildIndent == nIndent)
break;
#ifdef _SZYAML_DEBUG_TRACE
kconsole::printf(_T(" ### (%d, %d)\r\n"), LastKey.nChildIndent, nIndent);
#endif
if (LastKey.nChildIndent < nIndent)
{
#ifdef _SZYAML_DEBUG_TRACE
kconsole::printf(_T(" * ERROR: Line %d, Indent Error\r\n"), nLineNum);
#endif
goto Exit0;
}
listKeyStack.RemoveTail();
#ifdef _SZYAML_DEBUG_TRACE
{ // Trace Key Stack
kconsole::printf(_T(" "));
for (POSITION pos = listKeyStack.GetHeadPosition(); pos != NULL; listKeyStack.GetNext(pos))
{
_KeyStackNode key = listKeyStack.GetAt(pos);
kconsole::printf(_T("(%d, '%s', %d)"), key.nChildIndent, key.strKey, key.bIsList);
}
kconsole::printf(_T("\r\n"));
}
#endif
}
if (bIsListItem && !bNewChild)
{
_KeyStackNode &LastKey = listKeyStack.GetTail();
SZYamlNode newNode;
newNode.SetKey(LastKey.strKey);
_AppendNode((int)listKeyStack.GetCount() - 1, newNode);
}
if (1 < strValue.GetLength() && strValue[0] == strValue[strValue.GetLength() - 1]
&& (_T('\'') == strValue[0] || _T('\"') == strValue[0]))
strValue = strValue.Mid(1, strValue.GetLength() - 2);
if (strValue.IsEmpty())
{
_KeyStackNode &NewKey = listKeyStack.GetAt(listKeyStack.AddTail());
NewKey.nIndent = nIndent;
NewKey.strKey = strKey;
bNewChild = TRUE;
}
else
bNewChild = FALSE;
{
SZYamlNode newNode;
newNode.SetKey(strKey);
newNode.SetValue(strValue);
_AppendNode((int)listKeyStack.GetCount() - (bNewChild ? 1 : 0), newNode);
}
nThisLinePos = nNextLinePos + 1;
++ nLineNum;
}
SZYamlHandle::_SetPosition(this, m_YamlItemList.GetHeadPosition());
bResult = TRUE;
Exit0:
return bResult;
}