本文整理汇总了C++中clang::QualType::dump方法的典型用法代码示例。如果您正苦于以下问题:C++ QualType::dump方法的具体用法?C++ QualType::dump怎么用?C++ QualType::dump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clang::QualType
的用法示例。
在下文中一共展示了QualType::dump方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
std::string UWrapperGeneratorVB6Declare::ClangTypeToVB6(const clang::QualType& type, bool* success, bool canHaveRef, bool* isRef /*= 0*/)
{
if (isRef)
*isRef = false;
if (type->isFunctionPointerType()) {
return "Long";
}
else if (type->getTypeClass() == clang::Type::Builtin) {
const clang::BuiltinType* builtInType = type->getAs<clang::BuiltinType>();
return ClangBuiltinTypeToVB6(builtInType, success);
}
else if (type->getTypeClass() == clang::Type::Pointer) {
const clang::PointerType* pointerType = type->getAs<clang::PointerType>();
const clang::QualType& pointeeType = pointerType->getPointeeType();
if (pointeeType->getTypeClass() == clang::Type::Builtin) {
const clang::BuiltinType* pointeeTypeBuiltin = pointeeType->getAs<clang::BuiltinType>();
switch (pointeeTypeBuiltin->getKind()) {
case clang::BuiltinType::SChar:
case clang::BuiltinType::Char_S:
case clang::BuiltinType::UChar:
case clang::BuiltinType::Char_U: return "String"; //char* --> String
case clang::BuiltinType::Void: return "Long"; // void* --> Long
default:
if (m_ptrToLong)
return "Long";
if (canHaveRef) {
if (isRef)
*isRef = true;
return ClangBuiltinTypeToVB6(pointeeTypeBuiltin, success);
}
}
}
if (m_ptrToLong)
return "Long";
std::string conv = ClangTypeToVB6(pointeeType, success, false);
if (canHaveRef) {
if (isRef)
*isRef = true;
return conv;
}
return "Long";
}
else if (type->getTypeClass() == clang::Type::Typedef) {
return ClangTypeToVB6(type->getAs<clang::TypedefType>()->desugar(), success, canHaveRef, isRef);
}
else if (type->getTypeClass() == clang::Type::Elaborated) {
return ClangTypeToVB6(type->getAs<clang::ElaboratedType>()->desugar(), success, canHaveRef, isRef);
}
else if (type->getTypeClass() == clang::Type::Paren) {
return ClangTypeToVB6(type->getAs<clang::ParenType>()->desugar(), success, canHaveRef, isRef);
}
else if (type->getTypeClass() == clang::Type::Enum) {
const clang::EnumType* enumType = type->getAs<clang::EnumType>();
if (m_collectedEnums.find(enumType->getDecl()) != m_collectedEnums.end()) {
return clang::QualType(enumType, 0).getAsString();
}
}
else if (type->getTypeClass() == clang::Type::Record) {
const clang::RecordType* recType = type->getAs<clang::RecordType>();
if (m_collectedRecords.find(recType->getDecl()) != m_collectedRecords.end())
return recType->getDecl()->getNameAsString();
}
if (success)
*success = false;
std::cout << type->getTypeClassName() << std::endl;
type->dump();
return "<Unsupported>";
}
开发者ID:Wohlhabend-Networks,项目名称:Ultimate-Wrapper-Generator,代码行数:75,代码来源:UWrapperGeneratorVB6Declare.cpp