MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / printFunction

Function printFunction

src/attributes.cpp:1117–1136  ·  view source on GitHub ↗

Print function

Source from the content-addressed store, hash-verified

1115
1116 // Print function
1117 void printFunction(std::ostream& os,
1118 const Function& function,
1119 bool printArgDefaults = true) {
1120
1121 if (!function.empty()) {
1122 if (!function.type().empty()) {
1123 os << function.type();
1124 os << " ";
1125 }
1126 os << function.name();
1127 os << "(";
1128 const std::vector<Argument>& arguments = function.arguments();
1129 for (std::size_t i = 0; i<arguments.size(); i++) {
1130 printArgument(os, arguments[i], printArgDefaults);
1131 if (i != (arguments.size()-1))
1132 os << ", ";
1133 }
1134 os << ")";
1135 }
1136 }
1137
1138 // Function operator <<
1139 std::ostream& operator<<(std::ostream& os, const Function& function) {// #nocov start

Callers 3

attributes.cppFile · 0.85
writeEndMethod · 0.85
generateCppFunction · 0.85

Calls 3

printArgumentFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected