I'm trying to use the Set_open_handler function but I neither understand it nor find a suitable example. In the documentation a lambda function is used:
But I'd like to use a "real" one to generate a individual intro for each new file. How should a function look like to return a string to satisfy Set_open_handler / Set_close_handler.
Does anyone have an example I understand?
Thank you
Sebastian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The callback you install with set_open/close_handler should have the following signature:
void (stream_type&)
Where stream_type is a typedef within the sink backend and essentially is std::ostream or std::wostream. The callback should put the file header/footer to the provided stream.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to use the Set_open_handler function but I neither understand it nor find a suitable example. In the documentation a lambda function is used:
But I'd like to use a "real" one to generate a individual intro for each new file. How should a function look like to return a string to satisfy Set_open_handler / Set_close_handler.
Does anyone have an example I understand?
Thank you
Sebastian
The callback you install with set_open/close_handler should have the following signature:
Where stream_type is a typedef within the sink backend and essentially is std::ostream or std::wostream. The callback should put the file header/footer to the provided stream.
Thank you for the quick response. It works perfect now. Much easier than expected.