本文整理汇总了C++中TypeInfo::toString方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeInfo::toString方法的具体用法?C++ TypeInfo::toString怎么用?C++ TypeInfo::toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeInfo
的用法示例。
在下文中一共展示了TypeInfo::toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
/*Type* DeclarationNode::buildType(DeclarationSpecifiersNode::TypeInfo tInfo) const
{
Type* type = NULL;
bool unsignedSpecified = tInfo.unsignedSpecified;
int integral = tInfo.integral;
bool longSpecified = tInfo.longLongSpecified;
bool longLongSpecified = tInfo.longLongSpecified;
if (unsignedSpecified) {
if (integral==Char)
type = new BuiltinType<char>(Type::uChar);
else if (integral==Short)
type = new BuiltinType<short>(Type::uShort);
else if (integral==Int)
type = new BuiltinType<int>(Type::uInt);
else if (longLongSpecified)
type = new BuiltinType<unsigned long long>(Type::uLongLong);
else if (longSpecified)
type = new BuiltinType<unsigned long>(Type::uLong);
}
else {
if (integral==Int) {
if (longLongSpecified)
type = new BuiltinType<long long>(Type::Long);
else if (longSpecified)
type = new BuiltinType<long>(Type::Long);
else
type = new BuiltinType<int>(Type::Int);
}
else {
if (integral==Char)
type = new BuiltinType<char>(Type::Char);
else if (Short)
type = new BuiltinType<short>(Type::Short);
else if (integral==Float)
type = new BuiltinType<float>(Type::Float);
else if (integral==Double)
type = new BuiltinType<double>(Type::Double);
}
}
return type;
}
*/
std::string DeclarationNode::toString() const
{
std::string s="DeclarationNode: \n" ;
TypeInfo t = declSpecifier->getTypeInfo();
s+= "\t" + t.toString() + "\n";
return s;
}
示例2: operator
auto operator()(const TypeInfo& type_info) { return type_info.toString(); }
示例3: doType
void doType(TypeInfo type)
{
cout << type.toString().toStdString();
}