本文整理汇总了C++中Namespace::getNamespaces方法的典型用法代码示例。如果您正苦于以下问题:C++ Namespace::getNamespaces方法的具体用法?C++ Namespace::getNamespaces怎么用?C++ Namespace::getNamespaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Namespace
的用法示例。
在下文中一共展示了Namespace::getNamespaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
示例2: 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";
}
}