本文整理汇总了C++中TypeNode::getActualTypeFullName方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeNode::getActualTypeFullName方法的具体用法?C++ TypeNode::getActualTypeFullName怎么用?C++ TypeNode::getActualTypeFullName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeNode
的用法示例。
在下文中一共展示了TypeNode::getActualTypeFullName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addTemplateClassInstance
TemplateClassInstanceTypeNode* NamespaceTypeNode::addTemplateClassInstance(TemplateClassInstanceNode* node)
{
std::string name = node->m_name->m_str;
std::string localName = node->m_name->m_str;
name += "<";
localName += "<";
auto begin = node->m_templateArguments.m_arguments.begin();
auto end = node->m_templateArguments.m_arguments.end();
for (auto it = begin; it != end; ++it)
{
if (it != begin)
{
name += ", ";
localName += ", ";
}
TypeNode* paramTypeNode = it->m_typeNode;
std::string paramName;
paramTypeNode->getActualTypeFullName(paramName);
name += paramName;
paramTypeNode->getFullName(paramName);
localName += paramName;
}
name += ">";
localName += ">";
TemplateClassInstanceTypeNode* result = m_children.addTypeNode<TemplateClassInstanceTypeNode>(this, name, node->m_name);
if (result)
{
result->m_localName = localName;
result->m_templateClassInstanceNode = node;
CopyChildren(result, node->m_classTypeNode);
}
return result;
}
示例2: findNodeByScopeName
TypeNode* TypeTree::findNodeByScopeName(ScopeNameNode* scopeNameNode, TypeNode* enclosingTypeTreeNode, TemplateArguments* templateArguments)
{
if (templateArguments && templateArguments->m_classTypeNode->isTemplateClass())//must be TypeNameNode::calcTypeNodes
{
if (scopeNameNode->isTemplateForm())
{
TypeNode* result = enclosingTypeTreeNode->getChildNode(scopeNameNode->m_name->m_str);
if (0 == result || !result->isTemplateClass())
{
return 0;
}
std::vector<TypeNameNode*> paramTypeNameNodes;
scopeNameNode->m_parameterList->collectTypeNameNodes(paramTypeNameNodes);
assert(!paramTypeNameNodes.empty());
if (paramTypeNameNodes.size() != static_cast<ClassTypeNode*>(result)->m_parameterNodes.size())
{
return 0;
}
bool hasUndeteminedType = false;
std::string name = scopeNameNode->m_name->m_str;
name += "<";
auto begin = paramTypeNameNodes.begin();
auto end = paramTypeNameNodes.end();
for (auto it = begin; it != end; ++it)
{
if (it != begin)
{
name += ", ";
}
TypeNameNode* paramTypeNameNode = *it;
assert(paramTypeNameNode->m_startTypeNode);
if (0 == paramTypeNameNode->m_typeNode ||
paramTypeNameNode->m_typeNode->isTemplateParameter() ||
paramTypeNameNode->m_typeNode->isTemplateClass() ||
paramTypeNameNode->m_typeNode->isUnderTemplateClass())
{
hasUndeteminedType = true;
break;
}
else
{
assert(paramTypeNameNode->m_typeNode->isPredefinedType() ||
paramTypeNameNode->m_typeNode->isEnum() ||
paramTypeNameNode->m_typeNode->isClass() ||
paramTypeNameNode->m_typeNode->isTemplateClassInstance() ||
paramTypeNameNode->m_typeNode->isTypedef() ||
paramTypeNameNode->m_typeNode->isTypeDeclaration());
std::string paramName;
paramTypeNameNode->m_typeNode->getActualTypeFullName(paramName);
name += paramName;
}
}
name += ">";
if (!hasUndeteminedType)
{
result = enclosingTypeTreeNode->getChildNode(name);
}
return result;
}
else
{
TypeNode* result = enclosingTypeTreeNode->getChildNode(scopeNameNode->m_name->m_str);
if (0 == result || result->isTemplateClass())
{
return 0;
}
return result;
}
}
else
{
if (scopeNameNode->isTemplateForm())
{
TypeNode* result = enclosingTypeTreeNode->getChildNode(scopeNameNode->m_name->m_str);
if (0 == result || !result->isTemplateClass())
{
return 0;
}
std::vector<TypeNameNode*> paramTypeNameNodes;
scopeNameNode->m_parameterList->collectTypeNameNodes(paramTypeNameNodes);
assert(!paramTypeNameNodes.empty());
if (paramTypeNameNodes.size() != static_cast<ClassTypeNode*>(result)->m_parameterNodes.size())
{
return 0;
}
bool hasUndeteminedType = false;
std::string name = scopeNameNode->m_name->m_str;
name += "<";
auto begin = paramTypeNameNodes.begin();
auto end = paramTypeNameNodes.end();
for (auto it = begin; it != end; ++it)
{
if (it != begin)
{
name += ", ";
}
TypeNameNode* paramTypeNameNode = *it;
TypeNode* paramTypeNode = paramTypeNameNode->getTypeNode(templateArguments);
if(0 == paramTypeNode)
{
//.........这里部分代码省略.........