How to change read/write method of source/sink device in C++ boost::iostreams?
I'm trying to get familiar with boost::iostream, so in a example program I'm writing, I want to read a text from a file and write it to file. I would use my inherited class from file_source/file_sink as device to read/write. In the read method, my class needs to add each character with one and write method needs to subtract one from each character. First of all, I want to make sure that the reading part of the program works properly so you can see the code as follow:
unfortunately, the result of std::cout << myStream.rdbuf() with above read method is nothing while if I delete the read method of MyFileSource class to use the read method of parent, the result will be correct. Any help will be appreciated.