kdbgstream::operator<<({,u}char)

Holger Freyther freyther at gmx.net
Tue Nov 12 12:10:03 GMT 2002


On Tuesday 12 November 2002 13:06, Bo Thorsen wrote:
> On Tuesday 12 November 2002 11:46, Stephan Kulow wrote:
> > Am Monday 11 November 2002 12:30 schrieb Marc Mutz:
> > > Hi!
> > >
> > > Shouldn't those output the char as character instead of number? If
> > > you want the value, you could then just write
> > >
> > > kdDebug() << int(mychar) << endl;
> > >
> > > while now you need to write ugly stuff like
> > >
> > > kdDebug() << QString( QChar( myChar ) ) << endl;
> > >
> > > to get the char output as character.
> > >
> > > (this is not a patch, just some hand-edited cut'n'paste)
> >
> > if you add a check for 0 and '\n' (to flush) I agree and would suggest
> > you commit it
>
> I can understand the check for 0, but I disagree about the '\n'. A flush
> happens upon endl, not on '\n'.
>
> std::cerr << "Something\n";
> std::cerr << "Something" << std::endl;
>
> The C++ standard says that the second flushes the stream, the first
> doesn't. Does the kdDebug stream not follow this?
looking at how kdbgstream& operator<< ( const QString& ) << is implementated
it does also check for \n and the issues a flush on the stream.

regards Holger
>
> Bo.

-- 
_____________________________________________
Holger 'zecke' Freyther
developer
Project OPIE- the Open Palmtop Integrated Environment
http://opie.handhelds.org | http://www.opie.info (german)
IRC: irc.freenode.net #opie #opie.de




More information about the kde-core-devel mailing list