本文整理汇总了C++中TStringList::GetHeadPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ TStringList::GetHeadPosition方法的具体用法?C++ TStringList::GetHeadPosition怎么用?C++ TStringList::GetHeadPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TStringList
的用法示例。
在下文中一共展示了TStringList::GetHeadPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateTargets
BOOL CInstanceTree::UpdateTargets()
{
// only do update if something has changed in the target view
if (!(m_pProjectManager->GetTargetTree())->m_bTargetTreeChanged)
{
return TRUE;
}
BOOL ret;
CXMLDocument tTargetDoc;
TStringList listNewTargets;
CXMLNode nodeTargetRoot;
CXMLNode nodeInstanceRoot;
// update lists
TStringList listUpdateChanged;
TStringList listUpdateNew;
TStringList listUpdateDeleted;
(m_pProjectManager->GetTargetTree())->m_bTargetTreeChanged = FALSE;
// get instance tree root node
if (!m_domDocument.GetRootNode(nodeInstanceRoot))
{
return FALSE;
}
// get root node of target view
IUnknown* pTmp = NULL;
HRESULT hr = m_pProjectManager->GetTargetViewDOM(&pTmp);
if(hr != S_OK)
{
return FALSE;
}
tTargetDoc.SetIXMLDocument(pTmp);
pTmp->Release();
// add target nodes as children
if(!tTargetDoc.GetRootNode(nodeTargetRoot))
{
return FALSE;
}
// get new targets from target view
if (!GetTargetsFromTargetTree(listNewTargets))
{
return FALSE;
}
// empty xml tree
nodeInstanceRoot.RemoveAllChilds();
// mark all nodes not used:
POSITION posH = m_mapInstanceTargets.GetStartPosition();
while(posH)
{
CString strId;
TInstanceTargetInfo* pInfo;
m_mapInstanceTargets.GetNextAssoc(posH, strId, pInfo);
if (pInfo)
{
pInfo->bUsed = FALSE;
}
}
// look at all new targets, hang targets into the tree:
// test if target is a new target or the attributes have changed or it is the same
// in the last two cases, take the old node and only change attributes if necessary
POSITION posNewTargets = listNewTargets.GetHeadPosition();
while(posNewTargets)
{
CXMLNode nodeTarget;
CXMLNode nodeInstance;
CXMLNode nodeLink;
// attributes of the target node
CString strTText; // node text
CString strTId; // node id
CString strTType; // node type (KAD type)
CString strTAddress; // connect info
CString strTUserAddress; // user connect info
CString strTConsoleAddress; // console address
CString strTAssignedResource; // assigned resource
CString strTSource; // source file for add on action
CString strParseSource; // parser source help var
CString strParseSourceNew; // parser source
CString strInstType; // type of the instance node
CString strIdPathTarg; // id path of target node in target tree
CString strIdPathInst; // id path of target instance in instance tree
CString strTargetId;
CString strWaitForTarget;
strIdPathTarg = listNewTargets.GetNext(posNewTargets);
strTargetId = strIdPathTarg;
int iFind = strTargetId.ReverseFind(CE_XML_IDPATH_SEP_CHAR);
ASSERT(iFind>0);
//.........这里部分代码省略.........