You can construct the object with any kind of std::iostream, it means that it can come from another serial library, it may be a std::stringstream or a std::fstream. However, do not use a fstream to open a serial port device.
The src:logtutorial is a simple example that displays on the standard output the binary command used to start the cover demo (warning: this will display non-ascii characters to your term if you do not redirect the standard output, you may want to use a tool like hexdump to see the result).