当前位置: 首页>>代码示例>>C++>>正文


C++ TStringList::GetNext方法代码示例

本文整理汇总了C++中TStringList::GetNext方法的典型用法代码示例。如果您正苦于以下问题:C++ TStringList::GetNext方法的具体用法?C++ TStringList::GetNext怎么用?C++ TStringList::GetNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TStringList的用法示例。


在下文中一共展示了TStringList::GetNext方法的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);
//.........这里部分代码省略.........
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:101,代码来源:InstanceTree.cpp


注:本文中的TStringList::GetNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。