• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ iconfigurationelement::Pointer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中iconfigurationelement::Pointer的典型用法代码示例。如果您正苦于以下问题:C++ Pointer类的具体用法?C++ Pointer怎么用?C++ Pointer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1:

IterateExpression::IterateExpression(
    const IConfigurationElement::Pointer& configElement)
{
  QString opValue = configElement->GetAttribute(ATT_OPERATOR);
  this->InitializeOperatorValue(opValue);
  this->InitializeEmptyResultValue(configElement->GetAttribute(ATT_IF_EMPTY));
}
开发者ID:151706061,项目名称:MITK,代码行数:7,代码来源:berryIterateExpression.cpp


示例2:

SystemTestExpression::SystemTestExpression(const IConfigurationElement::Pointer& element)
{
  fProperty = element->GetAttribute(ATT_PROPERTY);
  Expressions::CheckAttribute(ATT_PROPERTY, fProperty);
  fExpectedValue = element->GetAttribute(ATT_VALUE);
  Expressions::CheckAttribute(ATT_VALUE, fExpectedValue);
}
开发者ID:151706061,项目名称:MITK,代码行数:7,代码来源:berrySystemTestExpression.cpp


示例3:

SystemTestExpression::SystemTestExpression(IConfigurationElement::Pointer element)
{
  bool result = element->GetAttribute(ATT_PROPERTY, fProperty);
  Expressions::CheckAttribute(ATT_PROPERTY, result);
  result = element->GetAttribute(ATT_VALUE, fExpectedValue);
  Expressions::CheckAttribute(ATT_VALUE, result);
}
开发者ID:test-fd301,项目名称:MITK,代码行数:7,代码来源:berrySystemTestExpression.cpp


示例4: ReadElement

bool PerspectiveRegistryReader::ReadElement(const IConfigurationElement::Pointer &element)
{
  if (element->GetName() == WorkbenchRegistryConstants::TAG_PERSPECTIVE)
  {
    try
    {
      QString id = element->GetAttribute(WorkbenchRegistryConstants::ATT_ID);
      PerspectiveDescriptor::Pointer desc(
          new PerspectiveDescriptor(id, element));
      QList<berry::IConfigurationElement::Pointer> childs = element->GetChildren("description");
      if (!childs.isEmpty())
      {
        desc->SetDescription(childs[0]->GetValue());
      }
      registry->AddPerspective(desc);
    }
    catch (const CoreException& e)
    {
      // log an error since its not safe to open a dialog here
      WorkbenchPlugin::Log("Unable to create layout descriptor.", e);//$NON-NLS-1$
    }
    return true;
  }

  return false;
}
开发者ID:151706061,项目名称:MITK,代码行数:26,代码来源:berryPerspectiveRegistryReader.cpp


示例5: result

Expression::Pointer
StandardElementHandler::Create(ExpressionConverter* converter, IConfigurationElement::Pointer element)
{
    std::string name = element->GetName();
    if (ExpressionTagNames::INSTANCEOF == name) {
        Expression::Pointer result(new InstanceofExpression(element));
        return result;
    } else if (ExpressionTagNames::TEST == name) {
        Expression::Pointer result(new TestExpression(element));
        return result;
    } else if (ExpressionTagNames::OR == name) {
        CompositeExpression::Pointer result(new OrExpression());
        this->ProcessChildren(converter, element, result);
        return result;
    } else if (ExpressionTagNames::AND == name) {
        CompositeExpression::Pointer result(new AndExpression());
        this->ProcessChildren(converter, element, result);
        return result;
    } else if (ExpressionTagNames::NOT == name) {
        IConfigurationElement::vector children(element->GetChildren());
        Expression::Pointer result(new NotExpression(converter->Perform(children[0])));
        return result;
    } else if (ExpressionTagNames::WITH == name) {
        CompositeExpression::Pointer result(new WithExpression(element));
        this->ProcessChildren(converter, element, result);
        return result;
    } else if (ExpressionTagNames::ADAPT == name) {
        CompositeExpression::Pointer result(new AdaptExpression(element));
        this->ProcessChildren(converter, element, result);
        return result;
    } else if (ExpressionTagNames::ITERATE == name) {
        CompositeExpression::Pointer result(new IterateExpression(element));
        this->ProcessChildren(converter, element, result);
        return result;
    } else if (ExpressionTagNames::COUNT == name) {
        Expression::Pointer result(new CountExpression(element));
        return result;
    } else if (ExpressionTagNames::SYSTEM_TEST == name) {
        Expression::Pointer result(new SystemTestExpression(element));
        return result;
    } else if (ExpressionTagNames::RESOLVE == name) {
        CompositeExpression::Pointer result(new ResolveExpression(element));
        this->ProcessChildren(converter, element, result);
        return result;
    } else if (ExpressionTagNames::ENABLEMENT == name) {
        CompositeExpression::Pointer result(new EnablementExpression(element));
        this->ProcessChildren(converter, element, result);
        return result;
    } else if (ExpressionTagNames::EQUALS == name) {
        Expression::Pointer result(new EqualsExpression(element));
        return result;
    } else if (ExpressionTagNames::REFERENCE == name) {
        Expression::Pointer result(new ReferenceExpression(element));
        return result;
    }
    return Expression::Pointer();
}
开发者ID:robotdm,项目名称:MITK,代码行数:57,代码来源:berryStandardElementHandler.cpp


示例6: AddWarning

SmartPointer<Expression> RegistryPersistence::ReadWhenElement(
    const SmartPointer<IConfigurationElement>& parentElement,
    const QString& whenElementName, const QString& id,
    QList<SmartPointer<IStatus> >& warningsToLog)
{
  // Check to see if we have an when expression.
  const QList<IConfigurationElement::Pointer> whenElements = parentElement
      ->GetChildren(whenElementName);
  Expression::Pointer whenExpression;
  if (!whenElements.isEmpty())
  {
    // Check if we have too many when elements.
    if (whenElements.size() > 1)
    {
      // There should only be one when element
      AddWarning(warningsToLog,
                 "There should only be one when element", parentElement,
                 id, "whenElementName", whenElementName);
      return ERROR_EXPRESSION;
    }

    const IConfigurationElement::Pointer whenElement = whenElements.front();
    const QList<IConfigurationElement::Pointer> expressionElements = whenElement->GetChildren();
    if (!expressionElements.isEmpty())
    {
      // Check if we have too many expression elements
      if (expressionElements.size() > 1)
      {
        // There should only be one expression element
        AddWarning(warningsToLog, "There should only be one expression element", parentElement,
                   id, "whenElementName", whenElementName);
        return ERROR_EXPRESSION;
      }

      // Convert the activeWhen element into an expression.
      const ElementHandler::Pointer elementHandler = ElementHandler::GetDefault();
      ExpressionConverter* const converter = ExpressionConverter::GetDefault();
      const IConfigurationElement::Pointer expressionElement = expressionElements.front();
      try
      {
        whenExpression = elementHandler->Create(converter, expressionElement);
      }
      catch (const CoreException& /*e*/)
      {
        // There when expression could not be created.
        AddWarning(warningsToLog, "Problem creating when element",
                   parentElement, id, "whenElementName", whenElementName);
        return ERROR_EXPRESSION;
      }
    }
  }

  return whenExpression;
}
开发者ID:151706061,项目名称:MITK,代码行数:54,代码来源:berryRegistryPersistence.cpp


示例7: GetPlugin

QSharedPointer<ctkPlugin> WorkbenchPlugin::GetBundleForExecutableExtension(
    const IConfigurationElement::Pointer& element, const QString& extensionName)
{
  // this code is derived heavily from
  // ConfigurationElement.createExecutableExtension.
  QString prop;
  QString executable;
  QString contributorName;
  int i = 0;

  if (!extensionName.isNull())
    prop = element->GetAttribute(extensionName);
  else
  {
    // property not specified, try as element value
    prop = element->GetValue();
    if (!prop.isNull())
    {
      prop = prop.trimmed();
      if (prop.isEmpty())
        prop = QString();
    }
  }

  if (prop.isNull())
  {
    // property not defined, try as a child element
    QList<IConfigurationElement::Pointer> exec(element->GetChildren(extensionName));
    if (!exec.isEmpty())
      contributorName = exec[0]->GetAttribute("plugin");
  }
  else
  {
    // simple property or element value, parse it into its components
    i = prop.indexOf(':');
    if (i != -1)
      executable = prop.left(i).trimmed();
    else
      executable = prop;

    i = executable.indexOf('/');
    if (i != -1)
      contributorName = executable.left(i).trimmed();
  }

  if (contributorName.isNull())
    contributorName = element->GetContributor()->GetName();

  return Platform::GetPlugin(contributorName);
}
开发者ID:paulcm,项目名称:MITK,代码行数:50,代码来源:berryWorkbenchPlugin.cpp


示例8: GetBundleForExecutableExtension

IBundle::Pointer WorkbenchPlugin::GetBundleForExecutableExtension(
    IConfigurationElement::Pointer element, const std::string& extensionName)
{
  // this code is derived heavily from
  // ConfigurationElement.createExecutableExtension.
  std::string prop;
  std::string executable;
  std::string contributorName;
  std::string::size_type i;

  if (extensionName != "")
    element->GetAttribute(extensionName, prop);
  else
  {
    // property not specified, try as element value
    prop = element->GetValue();
    if (prop != "")
    {
      Poco::trimInPlace(prop);
    }
  }

  if (prop == "")
  {
    // property not defined, try as a child element
    IConfigurationElement::vector exec(element->GetChildren(extensionName));
    if (exec.size() != 0)
      exec[0]->GetAttribute("plugin", contributorName); //$NON-NLS-1$
  }
  else
  {
    // simple property or element value, parse it into its components
    i = prop.find_first_of(':');
    if (i != std::string::npos)
      executable = Poco::trim(prop.substr(0, i));
    else
      executable = prop;

    i = executable.find_first_of('/');
    if (i != std::string::npos)
      contributorName = Poco::trim(executable.substr(0, i));

  }

  if (contributorName == "")
    contributorName = element->GetContributor();

  return Platform::GetBundle(contributorName);
}
开发者ID:test-fd301,项目名称:MITK,代码行数:49,代码来源:berryWorkbenchPlugin.cpp


示例9: LogError

void RegistryReader::LogError(IConfigurationElement::Pointer element,
    const std::string& text)
{
  const IExtension* extension = element->GetDeclaringExtension();
  std::string buf = "Plugin " + extension->GetNamespace() + ", extension "
      + extension->GetExtensionPointIdentifier();
  // look for an ID if available - this should help debugging
  std::string id;
  if (element->GetAttribute("id", id))
  {
    buf.append(", id ");
    buf.append(id);
  }
  buf.append(": " + text);
  WorkbenchPlugin::Log(buf);
}
开发者ID:AGrafmint,项目名称:MITK,代码行数:16,代码来源:berryRegistryReader.cpp


示例10: HasExecutableExtension

bool WorkbenchPlugin::HasExecutableExtension(
    const IConfigurationElement::Pointer& element, const QString& extensionName)
{
  if (!element->GetAttribute(extensionName).isNull()) return true;

  QString elementText = element->GetValue();
  if (!elementText.isEmpty()) return true;

  QList<IConfigurationElement::Pointer> children(element->GetChildren(extensionName));
  if (children.size() == 1)
  {
    if (!(children[0]->GetAttribute(WorkbenchRegistryConstants::ATT_CLASS).isNull()))
      return true;
  }
  return false;
}
开发者ID:paulcm,项目名称:MITK,代码行数:16,代码来源:berryWorkbenchPlugin.cpp


示例11: CoreException

IntroDescriptor::IntroDescriptor(IConfigurationElement::Pointer configElement)
    throw (CoreException) :
  element(configElement)
{
  std::string val;
  if (!configElement->GetAttribute(WorkbenchRegistryConstants::ATT_CLASS, val))
  {
    //TODO IStatus
    /*
    throw CoreException(new Status(IStatus.ERROR,
        configElement .getNamespace(), 0,
        "Invalid extension (Missing class name): " + getId(), //$NON-NLS-1$
        null));
        */
    throw CoreException(configElement->GetContributor() + ": Invalid extension (Missing className): " + GetId());
  }
}
开发者ID:david-guerrero,项目名称:MITK,代码行数:17,代码来源:berryIntroDescriptor.cpp


示例12: ProcessExtension

bool PerspectiveExtensionReader::ProcessExtension(
    IConfigurationElement::Pointer element)
{
  IConfigurationElement::vector children = element->GetChildren();
  for (unsigned int nX = 0; nX < children.size(); nX++)
  {
    IConfigurationElement::Pointer child = children[nX];
    std::string type = child->GetName();
    if (this->IncludeTag(type))
    {
      bool result = false;
      if (type == WorkbenchRegistryConstants::TAG_ACTION_SET)
      {
        result = this->ProcessActionSet(child);
      }
      else if (type == WorkbenchRegistryConstants::TAG_VIEW)
      {
        result = this->ProcessView(child);
      }
      else if (type == WorkbenchRegistryConstants::TAG_VIEW_SHORTCUT)
      {
        result = this->ProcessViewShortcut(child);
      }
//      else if (type == IorkbenchRegistryConstants::TAG_NEW_WIZARD_SHORTCUT)
//      {
//        result = processWizardShortcut(child);
//      }
      else if (type == WorkbenchRegistryConstants::TAG_PERSP_SHORTCUT)
      {
        result = this->ProcessPerspectiveShortcut(child);
      }
      else if (type == WorkbenchRegistryConstants::TAG_SHOW_IN_PART)
      {
        result = this->ProcessShowInPart(child);
      }
      if (!result)
      {
        WorkbenchPlugin::Log("Unable to process element: " + //$NON-NLS-1$
            type + " in perspective extension: " + //$NON-NLS-1$
            element->GetDeclaringExtension()->GetUniqueIdentifier());
      }
    }
  }
  return true;
}
开发者ID:AGrafmint,项目名称:MITK,代码行数:45,代码来源:berryPerspectiveExtensionReader.cpp


示例13: SetConfigurationElement

void PartSite::SetConfigurationElement(
    IConfigurationElement::Pointer configElement)
{

  // Get extension ID.
  configElement->GetAttribute("id", extensionID); //$NON-NLS-1$

  // Get plugin ID.
  pluginID = configElement->GetContributor();

  // Get extension name.
  std::string name;
  configElement->GetAttribute("name", name); //$NON-NLS-1$
  if (name != "")
  {
    extensionName = name;
  }
}
开发者ID:AGrafmint,项目名称:MITK,代码行数:18,代码来源:berryPartSite.cpp


示例14:

  bool
  Expressions::GetOptionalBooleanAttribute(IConfigurationElement::Pointer element, const std::string& attributeName)
  {
    std::string value;
    if (element->GetAttribute(attributeName, value))
      return Poco::toLower<std::string>(value) == "true";

    return false;
  }
开发者ID:test-fd301,项目名称:MITK,代码行数:9,代码来源:berryExpressions.cpp


示例15: GetDescription

std::string RegistryReader::GetDescription(IConfigurationElement::Pointer configElement)
{
  IConfigurationElement::vector children(configElement->GetChildren(WorkbenchRegistryConstants::TAG_DESCRIPTION));
  if (children.size() >= 1)
  {
    return children[0]->GetValue();
  }
  return "";//$NON-NLS-1$
}
开发者ID:AGrafmint,项目名称:MITK,代码行数:9,代码来源:berryRegistryReader.cpp


示例16: GetClassValue

std::string RegistryReader::GetClassValue(
    IConfigurationElement::Pointer configElement,
    const std::string& classAttributeName)
{
  std::string className;
  if (configElement->GetAttribute(classAttributeName, className))
  {
    return className;
  }
  IConfigurationElement::vector candidateChildren(configElement->GetChildren(classAttributeName));
  if (candidateChildren.size() == 0)
  {
    return "";
  }

  candidateChildren[0]->GetAttribute(WorkbenchRegistryConstants::ATT_CLASS, className);
  return className;
}
开发者ID:AGrafmint,项目名称:MITK,代码行数:18,代码来源:berryRegistryReader.cpp


示例17: ParseArguments

 void
 Expressions::GetArguments(std::vector<Object::Pointer>& args, IConfigurationElement::Pointer element, const std::string& attributeName)
 {
   std::string value;
   if (element->GetAttribute(attributeName, value))
   {
     ParseArguments(args, value);
   }
 }
开发者ID:test-fd301,项目名称:MITK,代码行数:9,代码来源:berryExpressions.cpp


示例18: status

TestExpression::TestExpression(const IConfigurationElement::Pointer& element)
{
  QString property = element->GetAttribute(ATT_PROPERTY);
  int pos = property.lastIndexOf(PROP_SEP);
  if (pos == -1)
  {
    IStatus::Pointer status(new ExpressionStatus(
                              ExpressionStatus::NO_NAMESPACE_PROVIDED,
                              "The property attribute of the test expression must be qualified by a name space.",
                              BERRY_STATUS_LOC));
    throw CoreException(status);
  }
  fNamespace = property.left(pos);
  fProperty = property.mid(pos + 1);
  fArgs = Expressions::GetArguments(element, ATT_ARGS);
  fExpectedValue = Expressions::ConvertArgument(element->GetAttribute(ATT_VALUE));
  fForcePluginActivation = Expressions::GetOptionalBooleanAttribute(element, ATT_FORCE_PLUGIN_ACTIVATION);
}
开发者ID:paulcm,项目名称:MITK,代码行数:18,代码来源:berryTestExpression.cpp


示例19: ProcessPerspectiveShortcut

bool PerspectiveExtensionReader::ProcessPerspectiveShortcut(
    IConfigurationElement::Pointer element)
{
  std::string id;
  if (element->GetAttribute(WorkbenchRegistryConstants::ATT_ID, id))
  {
    pageLayout->AddPerspectiveShortcut(id);
  }
  return true;
}
开发者ID:AGrafmint,项目名称:MITK,代码行数:10,代码来源:berryPerspectiveExtensionReader.cpp


示例20: ReadElement

bool PerspectiveExtensionReader::ReadElement(
    IConfigurationElement::Pointer element)
{
  std::string type = element->GetName();
  if (type == WorkbenchRegistryConstants::TAG_PERSPECTIVE_EXTENSION)
  {
    std::string id;
    element->GetAttribute(WorkbenchRegistryConstants::ATT_TARGET_ID, id);
    if (targetID == id || "*" == id)
    { //$NON-NLS-1$
//      if (tracker != null)
//      {
//        tracker.registerObject(element.getDeclaringExtension(),
//            new DirtyPerspectiveMarker(id), IExtensionTracker.REF_STRONG);
//      }
      return this->ProcessExtension(element);
    }
    return true;
  }
  return false;
}
开发者ID:AGrafmint,项目名称:MITK,代码行数:21,代码来源:berryPerspectiveExtensionReader.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ icu::UInitOnce类代码示例发布时间:2022-05-31
下一篇:
C++ iceutilinternal::Options类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap