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