MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / FormatCast

Method FormatCast

CodeGenerator.cpp:4551–4564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4549//-----------------------------------------------------------------------------
4550
4551void CodeGenerator::FormatCast(const std::string_view castName,
4552 const QualType& castDestType,
4553 const Expr* subExpr,
4554 const CastKind& castKind)
4555{
4556 const bool isCastToBase{is{castKind}.any_of(CK_DerivedToBase, CK_UncheckedDerivedToBase) and
4557 castDestType->isRecordType()};
4558 const std::string castDestTypeText{
4559 StrCat(GetName(castDestType), ((isCastToBase and not castDestType->isAnyPointerType()) ? "&"sv : ""sv))};
4560
4561 mOutputFormatHelper.Append(castName, "<"sv, castDestTypeText, ">("sv);
4562 InsertArg(subExpr);
4563 mOutputFormatHelper.Append(')');
4564}
4565//-----------------------------------------------------------------------------
4566
4567void CodeGenerator::InsertArgWithParensIfNeeded(const Stmt* stmt)

Callers

nothing calls this directly

Calls 4

StrCatFunction · 0.85
GetNameFunction · 0.85
any_ofMethod · 0.80
AppendMethod · 0.80

Tested by

no test coverage detected