Re: [boost] IOStreams formal review

Carlo Wood wrote:
On Tue, Sep 07, 2004 at 07:41:25AM +0200, John Torjo wrote:
Why binary? I could see lots of uses for text as well.
Because text is a special case of binary. If the library supports streambufs, and when it would support the concept of 'message blocks', then "text" just means that you'd detect End-Of-Line sequences and cut the stream into messages that are in fact lines of text.
Bring a text stream means that you do \r\n <--> \n normalization for the streams (or whatever end of line encoding your OS uses). That, AFAIK, is the only percievable difference between the two modes according to the standard. (I am not sure how text streams handle '\0').
Actually putting that text in a std::string and doing some work on it should be in user code imho.
This would be inefficient in most contexts. Especially if you have a complex filter chain with inbuilt buffers that are only concerned with character-by-character processing. I understand that in some cases it would be useful to see the data as a sequence of lines stored as std::string, but then isn't that what: std::string str; std::ifstream in( "data.txt" ); while( std::getline( in, str )) { std::cout << "line = " << str << '\n'; } is for? Regards, Reece _________________________________________________________________ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger

"Reece Dunn" <msclrhd@hotmail.com> wrote in message news:BAY24-F4KAputaSLGE800068dfb@hotmail.com...
Carlo Wood wrote:
Actually putting that text in a std::string and doing some work on it should be in user code imho.
This would be inefficient in most contexts. Especially if you have a complex filter chain with inbuilt buffers that are only concerned with character-by-character processing.
FWIW, the authors of the filtering proposal mentioned by Dietmar Kuehl -- JC van Winkel and John van Krieken -- tried an implementation of filtering in which filters communicate through std::strings, and found it had very poor performance. Jonathan

On Tue, Sep 07, 2004 at 10:37:08AM -0600, Jonathan Turkanis wrote:
"Reece Dunn" <msclrhd@hotmail.com> wrote in message news:BAY24-F4KAputaSLGE800068dfb@hotmail.com...
Carlo Wood wrote:
Actually putting that text in a std::string and doing some work on it should be in user code imho.
This would be inefficient in most contexts. Especially if you have a complex filter chain with inbuilt buffers that are only concerned with character-by-character processing.
FWIW, the authors of the filtering proposal mentioned by Dietmar Kuehl -- JC van Winkel and John van Krieken -- tried an implementation of filtering in which filters communicate through std::strings, and found it had very poor performance.
Like I said, it should not be part of the library (but if one insists on using std::string - it should be in the users code). No need to make a whole thread of that remark when everyone agrees. -- Carlo Wood <carlo@alinoe.com>
participants (3)
-
Carlo Wood
-
Jonathan Turkanis
-
Reece Dunn