How to capture the output of an interpreter embedded in a C++ program?

I have Cling embedded in my C++ program and want to make some post-processing in it’s output to show the result in a GUI widget. Is this posible?

Hi,

You could maybe use cling’s Jupyter interface! Or you can redirect the output to a file, using cling::MetaProcessor’s “.> output.txt” directive. The latter might well be a pipe that you are listening to from a C++ program on the other end.

Cheers, Axel.

Thanks for your reply,

I found a couple of classes on the web to dial with it, I’m posting those here if anyone is interested.

Obj-C source:
github.com/zpasternack/Redirect … director.m

C++ source:
github.com/zpasternack/Redirect … rector.cpp

Regards.