Ufff.
Thanks for your patience....
I already have a int to string converter , the std::stringstream does the work.
I use this stringstream to store the elements I want to show later (to a file, to a listbox, to QtCreator application output, etc. )
I have << operator for every type (including QString), so when I call W_debug()<< 33; I store the data into my stringstream.
W_debug
& operator <<
(const QString data
) ;
W_debug & operator << (const std::string data);
W_debug & operator << (const char data) ;
W_debug & operator << (const char * data) ;
.....
W_debug & operator << (const QString data) ;
W_debug & operator << (const std::string data);
W_debug & operator << (const char data) ;
W_debug & operator << (const char * data) ;
.....
To copy to clipboard, switch view to plain text mode
I have to use const char * data to accept <<"hello" .
If I implement an ' output'(to file, to listbox,etc) on every << , w_debug()<<"1"<<"2"<<"3"; will gives me 3 lines and I want 1.
To avoid this, my idea is to store the information into the stringstream while I have << << << and output when I finish the calls to W_debug.
Now, the 'magic' is how can I know when a '<<' are the last ?
I hope you understand me now and thanks again.
Bookmarks