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


C++ Namespace::getName方法代码示例

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


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

示例1: process

void Doclet::process(Namespace& instance)
{
  if (&instance != _root) {
    _outputBuffer += "namespace " + instance.getName() + "\n";
    _outputBuffer += "{\n";
  }

  typedef std::vector <Include*>::iterator IncludeIterType;
  for (IncludeIterType iter = instance.getIncludes().begin(); iter != instance.getIncludes().end(); iter++) {
    process(**iter);
  }
  _outputBuffer += "\n";

  typedef std::vector <Namespace*>::iterator NamespaceIterType;
  for (NamespaceIterType iter = instance.getNamespaces().begin(); iter != instance.getNamespaces().end(); iter++) {
    process(**iter);
  }

  typedef std::vector <Class*>::iterator ClassIterType;
  for (ClassIterType iter = instance.getClasses().begin(); iter != instance.getClasses().end(); iter++) {
    process(**iter);
  }

  if (&instance != _root) {
    _outputBuffer += "}\n\n\n";
  }
}
开发者ID:williamwaterson,项目名称:protolayer,代码行数:27,代码来源:Doclet.cpp

示例2: prewalk

void Doclet::prewalk(Namespace& instance)
{
  std::string namespaceName = instance.getName();

  if (instance.hasDocumentation()) {
    Documentation* documentation = instance.getDocumentation();
    if (documentation->containsAnnotation("@prototype") || documentation->containsAnnotation("@prototyped")) {
    }
  }

  typedef std::vector <Include*>::iterator IncludeIterType;
  for (IncludeIterType iter = instance.getIncludes().begin(); iter != instance.getIncludes().end(); iter++) {
    prewalk(**iter);
  }

  typedef std::vector <Class*>::iterator ClassIterType;
  for (ClassIterType iter = instance.getClasses().begin(); iter != instance.getClasses().end(); iter++) {
    prewalk(**iter);
  }

  typedef std::vector <Namespace*>::iterator NamespaceIterType;
  for (NamespaceIterType iter = instance.getNamespaces().begin(); iter != instance.getNamespaces().end(); iter++) {
    prewalk(**iter);
  }

}
开发者ID:williamwaterson,项目名称:protolayer,代码行数:26,代码来源:Doclet.cpp

示例3: if

NotFoundException::NotFoundException(const Namespace& name_space,
                                     const Item& item) throw()
{
    string nsCategory;
    if (dynamic_cast<const Class*>(&name_space))
        nsCategory = "Class";
    else
        nsCategory = "Namespace";

    string itemCategory;
    const Method* method = NULL;
    if (dynamic_cast<const Class*>(&item))
        itemCategory = "Class";
    else if (dynamic_cast<const Namespace*>(&item))
        itemCategory = "Namespace";
    else if (dynamic_cast<const Property*>(&item))
        itemCategory = "Property";
    else if (dynamic_cast<const Method*>(&item))
    {
        itemCategory = "Method";
        method = dynamic_cast<const Method*>(&item);
    }
    else if (dynamic_cast<const Function*>(&item))
        itemCategory = "Function";
    else if (dynamic_cast<const Type*>(&item))
        itemCategory = "Type";

    msg = nsCategory + " " + name_space.getName() + " has no " +
          itemCategory;

    if (!method || !method->hasFullSignature())
        msg += " with name " + item.getUnqualifiedName();
    else
        msg += " with signature " + method->getSignature();
}
开发者ID:gaurav1981,项目名称:eXtendedMirror,代码行数:35,代码来源:NotFoundException.cpp


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