[Top][All Lists]
[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> }
>
>
>
smime.p7s
Description: S/MIME Cryptographic Signature
- [help-cgicc] cgicc and Qt, Frank Büttner, 2009/03/22
- Re: [help-cgicc] cgicc and Qt, Steven King, 2009/03/23
- Re: [help-cgicc] cgicc and Qt, Frank Büttner, 2009/03/25
- Re[2]: [help-cgicc] cgicc and Qt, Igor, 2009/03/25
- Re: [help-cgicc] cgicc and Qt, Frank Büttner, 2009/03/25
- Re[2]: [help-cgicc] cgicc and Qt, Igor, 2009/03/25
- Re: [help-cgicc] cgicc and Qt, Frank Büttner, 2009/03/27
- Re[2]: [help-cgicc] cgicc and Qt, Igor, 2009/03/27
- Re: [help-cgicc] cgicc and Qt,
Frank Büttner <=