[Rcpp-commits] r3935 - in pkg/Rcpp: . inst/include/Rcpp/iostream src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Nov 11 12:24:04 CET 2012


Author: romain
Date: 2012-11-11 12:24:04 +0100 (Sun, 11 Nov 2012)
New Revision: 3935

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/include/Rcpp/iostream/Rstreambuf.h
   pkg/Rcpp/src/Rstreambuf.cpp
Log:
implement sync() so that flush works

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2012-11-10 20:45:13 UTC (rev 3934)
+++ pkg/Rcpp/ChangeLog	2012-11-11 11:24:04 UTC (rev 3935)
@@ -1,3 +1,8 @@
+2012-11-11  Romain Francois <romain at r-enthusiasts.com>
+
+        * include/Rcpp/iostream/Rstreambuf.h: implementing sync() so that flush works
+        * src/Rstreambuf.cpp: implementation
+
 2012-11-10  JJ Allaire <jj at rstudio.org>
 
         * R/Attributes.R: ensure function definitions are never stale

Modified: pkg/Rcpp/inst/include/Rcpp/iostream/Rstreambuf.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/iostream/Rstreambuf.h	2012-11-10 20:45:13 UTC (rev 3934)
+++ pkg/Rcpp/inst/include/Rcpp/iostream/Rstreambuf.h	2012-11-11 11:24:04 UTC (rev 3935)
@@ -37,6 +37,8 @@
         virtual std::streamsize xsputn(const char *s, std::streamsize n );
         
         virtual int overflow(int c = EOF );
+        
+        virtual int sync() ;
   };
 
 }

Modified: pkg/Rcpp/src/Rstreambuf.cpp
===================================================================
--- pkg/Rcpp/src/Rstreambuf.cpp	2012-11-10 20:45:13 UTC (rev 3934)
+++ pkg/Rcpp/src/Rstreambuf.cpp	2012-11-11 11:24:04 UTC (rev 3935)
@@ -33,3 +33,8 @@
     }
     return c;
 }
+
+int Rcpp::Rstreambuf::sync(){
+    R_FlushConsole() ;
+    return 0 ;    
+}



More information about the Rcpp-commits mailing list