Generate an R argument list for a function
| 2773 | |
| 2774 | // Generate an R argument list for a function |
| 2775 | std::string generateRArgList(const Function& function) { |
| 2776 | std::ostringstream argsOstr; |
| 2777 | const std::vector<Argument>& arguments = function.arguments(); |
| 2778 | for (size_t i = 0; i<arguments.size(); i++) { |
| 2779 | const Argument& argument = arguments[i]; |
| 2780 | argsOstr << argument.name(); |
| 2781 | if (!argument.defaultValue().empty()) { |
| 2782 | std::string rArg = cppArgToRArg(argument.type().name(), |
| 2783 | argument.defaultValue()); |
| 2784 | if (!rArg.empty()) { |
| 2785 | argsOstr << " = " << rArg; |
| 2786 | } else { |
| 2787 | showWarning("Unable to parse C++ default value '" + // #nocov start |
| 2788 | argument.defaultValue() + "' for argument "+ |
| 2789 | argument.name() + " of function " + |
| 2790 | function.name()); // #nocov end |
| 2791 | } |
| 2792 | } |
| 2793 | |
| 2794 | if (i != (arguments.size()-1)) |
| 2795 | argsOstr << ", "; |
| 2796 | } |
| 2797 | return argsOstr.str(); |
| 2798 | } |
| 2799 | |
| 2800 | bool checkRSignature(const Function& function, |
| 2801 | std::string args) { |
no test coverage detected