find . -name "*.cpp" -exec sed -i 's/std::cout/Rcpp::Rcout/g' {} \;This, or some variant, should get you there. I suggest version controlling your files before executing, just in case ;) Kevin On May 23, 2014 7:22 PM, "Dirk Eddelbuettel" <[email protected]> wrote: > > On 23 May 2014 at 21:22, Qiang Kou wrote: > | I am using Rcpp to integrate an available C++ library with R. > | > | Since the std::cout and std::cerr are not permitted when uploading to > CRAN, I > | have to modify files manually. It will be somewhat laborious if the > library > | > | Does anyone have any idea how can I do that automatically? > > I am afraid there is none. Rcpp::Rcout is a trick to fold 'our' output > into > R's; there is no trick to fold the system output. > > One trick may be to ... use the library as an external object that you link > to. That way CRAN won't check the library code as part of the submission > (but if it is a custom/complicated library you may have the problem of > getting onto CRAN build servers -- I am currently for libhiredis to make it > onto the win-builder / CRAN windows build side of things. > > But barring that you may need to change all std::cout instances (and yes, > I've done that once too). > > Dirk > > > -- > Dirk Eddelbuettel | [email protected] | http://dirk.eddelbuettel.com > _______________________________________________ > Rcpp-devel mailing list > [email protected] > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel >
_______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
