[iostreams] inverse and "stateful" filters
Hi, I wanted an InputFilter for removing comments from C++ source files. Since it seemed easier to write an OutputFilter, I decided to write that, and use iostreams::inverse to make an InputFilter out of it. However, it seems that inverse can't be used with "stateful" filters. Consider the following, using dictionary_output_filter from the tutorial: (http://www.boost.org/libs/iostreams/doc/index.html?path=2.2.6.3) namespace io = boost::iostreams; const std::string source("This foo will be bar"); io::example::dictionary dict; dict.add("foo", "bar"); io::filtering_istream in; in.push(io::invert(io::example::dictionary_output_filter(dict))); in.push(io::array_source(source.c_str(), source.length())); io::copy(in, std::cout); Output: This bar will be instead of the expected: This bar will be bar Is this a "known limitation"? Is there a workaround? Am I doing something silly? ----------------------------- Éric A conclusion is the place where you got tired of thinking
participants (1)
-
EMalenfant@interstarinc.com