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


C++ TVar::getChildren方法代码示例

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


在下文中一共展示了TVar::getChildren方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: writeHost


//.........这里部分代码省略.........
    writeTextElement( "mWhite2", pT->mWhite_2.name() );
    writeTextElement( "mLightWhite2", pT->mLightWhite_2.name() );
    writeTextElement( "mSpellDic", pT->mSpellDic );
    writeTextElement( "mLineSize", QString::number(pT->mLineSize) );
    writeTextElement( "mRoomSize", QString::number(pT->mRoomSize) );
    writeEndElement(); // end Host tag
    writeEndElement(); // end HostPackage tag

    writeStartElement( "TriggerPackage" );
    bool ret = true;
    typedef list<TTrigger *>::const_iterator ItTriggerUnit;
    for( ItTriggerUnit it1 = pT->mTriggerUnit.mTriggerRootNodeList.begin(); it1 != pT->mTriggerUnit.mTriggerRootNodeList.end(); it1++)
    {
        TTrigger * pChildTrigger = *it1;
        if( ! pChildTrigger || pChildTrigger->mModuleMember) continue;
        if( ! pChildTrigger->isTempTrigger())
        {
            ret = writeTrigger( pChildTrigger );
        }
    }
    writeEndElement(); //end trigger package tag

    writeStartElement("TimerPackage");
    typedef list<TTimer *>::const_iterator ItTimerUnit;
    for( ItTimerUnit it2 = pT->mTimerUnit.mTimerRootNodeList.begin(); it2 != pT->mTimerUnit.mTimerRootNodeList.end(); it2++)
    {
        TTimer * pChildTimer = *it2;
        if (pChildTimer->mModuleMember) continue;
        if( ! pChildTimer->isTempTimer())
        {
            ret = writeTimer( pChildTimer );
        }
    }
    writeEndElement();

    writeStartElement("AliasPackage");
    typedef list<TAlias *>::const_iterator ItAliasUnit;
    for( ItAliasUnit it3 = pT->mAliasUnit.mAliasRootNodeList.begin(); it3 != pT->mAliasUnit.mAliasRootNodeList.end(); it3++)
    {
        TAlias * pChildAlias = *it3;
        if (pChildAlias->mModuleMember) continue;
        if( ! pChildAlias->isTempAlias())
        {
            ret = writeAlias( pChildAlias );
        }
    }
    writeEndElement();

    writeStartElement("ActionPackage");
    typedef list<TAction *>::const_iterator ItActionUnit;
    for( ItActionUnit it4 = pT->mActionUnit.mActionRootNodeList.begin(); it4 != pT->mActionUnit.mActionRootNodeList.end(); it4++)
    {
        TAction * pChildAction = *it4;
        if (pChildAction->mModuleMember) continue;
        ret = writeAction( pChildAction );
    }
    writeEndElement();

    writeStartElement("ScriptPackage");
    typedef list<TScript *>::const_iterator ItScriptUnit;
    for( ItScriptUnit it5 = pT->mScriptUnit.mScriptRootNodeList.begin(); it5 != pT->mScriptUnit.mScriptRootNodeList.end(); it5++)
    {
        TScript * pChildScript = *it5;
        if (pChildScript->mModuleMember) continue;
        ret = writeScript( pChildScript );
    }
    writeEndElement();

    writeStartElement("KeyPackage");
    typedef list<TKey *>::const_iterator ItKeyUnit;
    for( ItKeyUnit it6 = pT->mKeyUnit.mKeyRootNodeList.begin(); it6 != pT->mKeyUnit.mKeyRootNodeList.end(); it6++)
    {
        TKey * pChildKey = *it6;
        if (pChildKey->mModuleMember) continue;
        ret = writeKey( pChildKey );
    }
    writeEndElement();

    writeStartElement("VariablePackage");
    LuaInterface * lI = pT->getLuaInterface();
    VarUnit * vu = lI->getVarUnit();
    //do hidden variables first
    writeStartElement("HiddenVariables");
    QSetIterator<QString> it8( vu->hiddenByUser );
    while( it8.hasNext() )
    {
        writeTextElement( "name", it8.next() );
    }
    writeEndElement();
    TVar * base = vu->getBase();
    QListIterator<TVar *> it7( base->getChildren() );
    while( it7.hasNext() )
    {
        TVar * var = it7.next();
        writeVariable( var, lI, vu );
    }
    writeEndElement();

    return ret;
}
开发者ID:Akivaii,项目名称:Mudlet,代码行数:101,代码来源:XMLexport.cpp

示例2: writeHost


//.........这里部分代码省略.........
        for (auto it = pHost->mTimerUnit.mTimerRootNodeList.begin(); isOk && it != pHost->mTimerUnit.mTimerRootNodeList.end(); ++it) {
            if (!(*it) || (*it)->mModuleMember) {
                continue;
            }
            if (!(*it)->isTempTimer()) {
                if (!writeTimer(*it)) {
                    isOk = false;
                }
            }
        }
        writeEndElement(); // </TimerPackage>
    }

    if (isOk) {
        writeStartElement("AliasPackage");
        for (auto it = pHost->mAliasUnit.mAliasRootNodeList.begin(); isOk && it != pHost->mAliasUnit.mAliasRootNodeList.end(); ++it) {
            if (!(*it) || (*it)->mModuleMember) {
                continue;
            }
            if (!(*it)->isTempAlias()) {
                if (!writeAlias(*it)) {
                    isOk = false;
                }
            }
        }
        writeEndElement(); // </AliasPackage>
    }

    if (isOk) {
        writeStartElement("ActionPackage");
        for (auto it = pHost->mActionUnit.mActionRootNodeList.begin(); isOk && it != pHost->mActionUnit.mActionRootNodeList.end(); ++it) {
            if (!(*it) || (*it)->mModuleMember) {
                continue;
            }
            if (!writeAction(*it)) {
                isOk = false;
            }
        }
        writeEndElement(); // </ActionPackage>
    }

    if (isOk) {
        writeStartElement("ScriptPackage");
        for (auto it = pHost->mScriptUnit.mScriptRootNodeList.begin(); isOk && it != pHost->mScriptUnit.mScriptRootNodeList.end(); ++it) {
            if (!(*it) || (*it)->mModuleMember) {
                continue;
            }
            if (!writeScript(*it)) {
                isOk = false;
            }
        }
        writeEndElement(); // </ScriptPackage>
    }

    if (isOk) {
        writeStartElement("KeyPackage");
        for (auto it = pHost->mKeyUnit.mKeyRootNodeList.begin(); isOk && it != pHost->mKeyUnit.mKeyRootNodeList.end(); ++it) {
            if (!(*it) || (*it)->mModuleMember) {
                continue;
            }
            if (!writeKey(*it)) {
                isOk = false;
            }
        }
        writeEndElement(); // </KeyPackage>
    }

    if (isOk) {
        writeStartElement("VariablePackage");
        LuaInterface* lI = pHost->getLuaInterface();
        VarUnit* vu = lI->getVarUnit();
        //do hidden variables first
        { // Blocked so that indentation reflects that of the XML file
            writeStartElement("HiddenVariables");
            QSetIterator<QString> itHiddenVariableName(vu->hiddenByUser);
            while (itHiddenVariableName.hasNext()) {
                writeTextElement("name", itHiddenVariableName.next());
            }
            writeEndElement(); // </HiddenVariables>
        }

        TVar* base = vu->getBase();
        if (!base) {
            lI->getVars(false);
            base = vu->getBase();
        }

        if (base) {
            QListIterator<TVar*> itVariable(base->getChildren(false));
            while (isOk && itVariable.hasNext()) {
                if (!writeVariable(itVariable.next(), lI, vu)) {
                    isOk = false;
                }
            }
        }
        writeEndElement(); // </VariablePackage>
    }

    return (isOk && (!hasError()));
}
开发者ID:SlySven,项目名称:Mudlet,代码行数:101,代码来源:XMLexport.cpp


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