本文整理汇总了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";
}
}
示例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);
}
}
示例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();
}