Boost logo

Boost :

From: christopher diggins (cdiggins_at_[hidden])
Date: 2005-02-28 17:39:36

> My next question is what is the best way to deal with an "output" device
> having a different cr\lf than another one?

Hi Brian,

My suggestion is to create another separate filter which does nothing but
convert \n to \r\n and add it to the chain:

class newline_conversion_filter : public output_filter {
  template<typename Sink>
  void put(Sink& dest, int c)
    if (c == '\n')
      boost::io::put(dest, '\r');
      boost::io::put(dest, '\n');
      boost::io::put(dest, c);

Does this help?

Christopher Diggins 

Boost list run by bdawes at, gregod at, cpdaniel at, john at