help-cgicc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [help-cgicc] cgicc and Qt


From: Frank Büttner
Subject: Re: [help-cgicc] cgicc and Qt
Date: Sat, 28 Mar 2009 11:57:17 +0100
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

Good morning Igor,

yes it is an good hind.:)
For multi threading, an QMutex will also be an option.
But for now this is not needed.

Thanks.

Igor schrieb:
> Hello Frank,
> 
> Friday, March 27, 2009, 9:23:55 PM, you wrote:
> 
> That's right. Now it is time to work on some improvements.
> 
> If you're not working on a multithreaded program use static, there is no
> need to re-create stringstream each time you want to use it. And we
> don't need tmp, it will slow you down a bit if the compiler
> isn't smart enough.
> 
>     static std::stringstream ss;
>     static QString tmp;
>     was.render(ss.str(""));
>     QTextStream::operator <<(QString::fromStdString(ss.str()));
>     return *this;
> 
> 
> I'm all so not sure if you require QTextStream at all. If you just want to
> redirect cout into a file you can do it by redefining cout's rdbuf.
> 
> Or you may use stringstream as the output buffer and then write it to a file
> or to a screen.
> 
> FB> #include "qtextstreamcgi.h"
> 
> FB> #include <sstream>
> FB> namespace QFrank
> FB> {
> FB> QTextStreamCGI::QTextStreamCGI(FILE *datei,QIODevice::OpenMode 
> zugriff):QTextStream(datei,zugriff)
> FB> {  
> FB> }
> FB> QTextStreamCGI &QTextStreamCGI:: operator <<(const cgicc::MStreamable 
> &was)
> FB> {
> FB>     std::stringstream ss;
> FB>     was.render(ss);
> FB>     QString tmp =QString::fromStdString(ss.str());
> FB>     QTextStream::operator <<(tmp);
> FB>     return *this;
> FB> }
> FB> }
> 
> 
> 

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]