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


C++ ConfigurationType::hasAttribute方法代码示例

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


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

示例1: attribute

 BOOST_FOREACH( ConfigurationType menu, vectMenus)
 {
     SLM_ASSERT("<menu> tag must have sid attribute", menu->hasAttribute("sid"));
     if(menu->hasAttribute("sid"))
     {
         bool start = false;
         if(menu->hasAttribute("start"))
         {
             std::string startValue = menu->getAttributeValue("start");
             SLM_ASSERT("Wrong value '"<< startValue <<"' for 'start' attribute (require yes or no)",
                     startValue == "yes" || startValue == "no");
             start = (startValue=="yes");
         }
         std::string sid = menu->getAttributeValue("sid");
         OSLM_ASSERT("Action " << sid << " already exists for this toolBar", m_menuSids.find(sid) == m_menuSids.end());
         m_menuSids[sid] = SIDToolBarMapType::mapped_type(index, start);
     }
     index++;
 }
开发者ID:corentindesfarges,项目名称:fw4spl,代码行数:19,代码来源:ToolBarRegistrar.cpp

示例2: initializeLayoutManager

void IGuiContainerSrv::initializeLayoutManager(ConfigurationType layoutConfig)
{
    OSLM_ASSERT("Bad configuration name "<<layoutConfig->getName()<< ", must be layout",
            layoutConfig->getName() == "layout");
    SLM_ASSERT("<layout> tag must have type attribute", layoutConfig->hasAttribute("type"));
    const std::string layoutManagerClassName = layoutConfig->getAttributeValue("type");

    ::fwGui::GuiBaseObject::sptr guiObj = ::fwGui::factory::New(layoutManagerClassName);
    m_viewLayoutManager = ::fwGui::layoutManager::IViewLayoutManager::dynamicCast(guiObj);
    OSLM_ASSERT("ClassFactoryRegistry failed for class "<< layoutManagerClassName, m_viewLayoutManager);

    m_viewLayoutManager->initialize(layoutConfig);
}
开发者ID:corentindesfarges,项目名称:fw4spl,代码行数:13,代码来源:IGuiContainerSrv.cpp

示例3: configuring

void Code::configuring()
{
    SLM_TRACE_FUNC();
    this->::fwGui::IGuiContainerSrv::initialize();
    std::vector < ConfigurationType > vectConfig = m_configuration->find("config");
    if(!vectConfig.empty())
    {
        std::vector < ConfigurationType > vectLanguage = vectConfig.at(0)->find("language");
        if(!vectLanguage.empty())
        {
            ConfigurationType configLanguage = vectLanguage.at(0);
            SLM_ASSERT("missing 'name' attribute in language tag", configLanguage->hasAttribute("name"));
            m_language = configLanguage->getAttributeValue("name");
        }
    }
}
开发者ID:fw4spl-org,项目名称:fw4spl,代码行数:16,代码来源:Code.cpp

示例4: initialize

void IActionSrv::initialize()
{
    m_registrar = ::fwGui::registrar::ActionRegistrar::New(this->getID());

    OSLM_ASSERT("Depreciated tag <name> in "<< this->getID() << " configuration.", ! m_configuration->hasAttribute("name"));
    OSLM_ASSERT("Depreciated tag <shortcut> in "<< this->getID() << " configuration.", ! m_configuration->hasAttribute("shortcut"));
    OSLM_ASSERT("Depreciated tag <enable> in "<< this->getID() << " configuration.", ! m_configuration->hasAttribute("enable"));
    OSLM_ASSERT("Depreciated tag <specialAction> in "<< this->getID() << " configuration.", ! m_configuration->hasAttribute("specialAction"));
    OSLM_ASSERT("Depreciated tag <style> in "<< this->getID() << " configuration.", ! m_configuration->hasAttribute("style"));
    OSLM_ASSERT("Depreciated tag <state> in "<< this->getID() << " configuration.", ! m_configuration->hasAttribute("state"));

    ::fwRuntime::ConfigurationElementContainer::Iterator iter ;
    for( iter = m_configuration->begin() ; iter != m_configuration->end() ; ++iter )
    {
        if( (*iter)->getName() == "state" )
        {
            ConfigurationType stateCfg = *iter;

            if( stateCfg->hasAttribute("inverse") )
            {
                std::string invertState = stateCfg->getExistingAttributeValue("inverse");
                SLM_ASSERT("Wrong attribute value : must be 'true' or 'false'", (invertState == "true") || (invertState == "false"));
                m_activeStateValue = !(invertState == "true") ;
            }

            if( stateCfg->hasAttribute("active") )
            {
                std::string isActive = stateCfg->getExistingAttributeValue("active");
                SLM_ASSERT("Wrong attribute value : must be 'true' or 'false'", (isActive == "true") || (isActive == "false"));
                m_isActive = (isActive == "true") ;
            }

            if( stateCfg->hasAttribute("executable") )
            {
                std::string isExecutable = stateCfg->getExistingAttributeValue("executable");
                SLM_ASSERT("Wrong attribute value : must be 'true' or 'false'", (isExecutable == "true") || (isExecutable == "false"));
                m_isExecutable = (isExecutable == "true") ;
            }
        }

        if( (*iter)->getName() == "confirmation" )
        {
            ConfigurationType cfg = *iter;

            SLM_ASSERT("Missing attribute 'value'", cfg->hasAttribute("value"));
            std::string confirm = cfg->getExistingAttributeValue("value");
            SLM_ASSERT("Wrong attribute value : must be 'true' or 'false'", (confirm == "true") || (confirm == "false"));
            m_confirmAction = (confirm == "true") ;

            if( cfg->hasAttribute("message") )
            {
                m_confirmMessage = cfg->getExistingAttributeValue("message");
            }

            if( cfg->hasAttribute("defaultbutton") )
            {
                m_defaultButton = cfg->getExistingAttributeValue("defaultbutton");
            }

        }
    }
}
开发者ID:corentindesfarges,项目名称:fw4spl,代码行数:62,代码来源:IActionSrv.cpp


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