11 #if !defined(RINSIDE_CALLBACKS) 12 int main(
int argc,
char *argv[]) {
13 printf(
"This example requires RInside to be compiled and installed with RINSIDE_CALLBACKS defined\nSee inst/include/RInsideConfig.h\n");
19 class MyCallbacks :
public Callbacks {
22 virtual void WriteConsole(
const std::string& line,
int type ) {
23 output_buffer << line << std::endl;
26 virtual bool has_WriteConsole() {
30 std::string getConsoleOutput() {
31 return output_buffer.str();
34 std::ostringstream output_buffer;
37 int main(
int argc,
char *argv[]) {
38 MyCallbacks *callbacks =
new MyCallbacks();
41 R.set_callbacks( callbacks );
45 std::string result = callbacks->getConsoleOutput();
46 printf(
"R said:\n%s\n", result.c_str());
Proxy parseEvalNT(const std::string &line)
int main(int argc, char *argv[])