dbTalk Databases Forums  

Re: another question

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Re: another question in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Warren Young
 
Posts: n/a

Default Re: another question - 10-16-2006 , 07:29 PM






Королев Илья wrote:
Quote:
why DateTime isn't a descendant of Date & Time?
I don't see why it is important to argue about past design decisions.
It is the way it is.

Quote:
I guess it should be useful.
If you agree that going forward is more important than arguing about the
past, then please provide some examples of where a change in the class
hierarchy would make it work better. Without that, we have no incentive
to change it. Aesthetics alone isn't a good enough reason to break the ABI.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #2  
Old   
Joel Fielder
 
Posts: n/a

Default RE: another question - 10-18-2006 , 03:46 AM






Hello,

Regarding "/usr/include/mysql++/stream2string.h:47: error: 'const struct
mysqlpp:Tbase<mysqlpp:ateTime>' has no member named 'out_stream'"

This is caused by the lack of out_stream in DTbase and its derived
classes so all you need to do is add out_stream member functions - see
below.

Joel.


In datetime.h:

1) Add to DTbase declaration

virtual std:stream& out_stream(std:stream& os) const = 0;

2) Add to each of DateTime, Date, and Time declarations:

virtual std:stream& out_stream(std:stream& os) const;

3) You might need MYSQLPP_EXPORT in those declarations, see previous
posts for more on that.



In datetime.cpp add these:

std:stream& DateTime:ut_stream(std:stream& os) const
{
return operator <<(os, *this);
}

std:stream& Date:ut_stream(std:stream& os) const
{
return operator <<(os, *this);
}

std:stream& Time:ut_stream(std:stream& os) const
{
return operator <<(os, *this);
}


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #3  
Old   
Joel Fielder
 
Posts: n/a

Default RE: another question - 10-18-2006 , 03:55 AM



Once more thing, somewhat related, in string2stream.h I have commented
out:

str << std::ends;

As far as I am aware std::ends is unnecessary with stringstream objects
and I remember it was causing problems after I added out_stream support
to the Dtbase classes (although I cannot remember the exact nature).

Joel.


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.