convert a C++ Matrix to an R argument (returns empty string if no conversion possible)
| 2670 | // convert a C++ Matrix to an R argument (returns empty string |
| 2671 | // if no conversion possible) |
| 2672 | std::string cppMatrixArgToRArg(const std::string& cppArg) { |
| 2673 | |
| 2674 | // look for Matrix |
| 2675 | std::string matrix = "Matrix"; |
| 2676 | size_t matrixLoc = cppArg.find(matrix); |
| 2677 | if (matrixLoc == std::string::npos || |
| 2678 | ((matrixLoc + matrix.length()) >= cppArg.size())) { |
| 2679 | return std::string(); |
| 2680 | } |
| 2681 | |
| 2682 | std::string args = cppArg.substr(matrixLoc + matrix.length()); |
| 2683 | return "matrix" + args; // #nocov end |
| 2684 | } |
| 2685 | |
| 2686 | // convert a C++ literal to an R argument (returns empty string |
| 2687 | // if no conversion possible) |
no test coverage detected