Re: [Boost-users] [1.36.0 beta] Beta release available on SourceForge
On Thursday 31 July 2008, Steven Watanabe wrote:
For wchar_t it might help to use wlocal_time_facet, e.g.
In Christ, Steven Watanabe
I changed the code in the wide functions to use the wlocal_time_facet (see attached sample) and now both non wide and wide behave the same. Thanks for the hint! I still wonder why I can apply a local_time_facet. Intuition tells me it should either work or not compile. I never thought the facet could be wrong, as it compiled. Thanks again for pointing that out! Still the biggest problem remains and that is that the library produces an output that I can not read back. If you know what I am doing wrong here in the testInput* fuctions any help is appreciated! $ /opt2/linux/ix86/bin/g++-4.3.1 -I/opt2/linux/x86_64/include/boost-1_36 -o boost1 boost1.cpp && (./boost1; ./boost1 1; ./boost1 1 2; ./boost1 1 2 3) testing testInputIso ... expected=2005 actual =2005 expected=Sep actual =Sep expected=30 actual =30 expected=19 actual =19 expected=25 actual =25 expected=17 actual =17 expected=1 actual =0 boost1: boost1.cpp:100: void testInputIso(): Assertion `(true) == (0 != ldt.zone().get())' failed. testing testInputIsoWide ... expected=2005 actual =2005 expected=Sep actual =Sep expected=30 actual =30 expected=19 actual =19 expected=25 actual =25 expected=17 actual =17 expected=1 actual =0 boost1: boost1.cpp:150: void testInputIsoWide(): Assertion `(true) == (0 != ldt.zone().get())' failed. testing testOutputIso ... expected=2005-09-30 19:25:17+01:00 actual =2005-09-30 19:25:17+01:00 expected=2005-09-30 19:25:17-08:00 actual =2005-09-30 19:25:17-08:00 testing testOutputIso OK testing testOutputIsoWide ... expected=2005-09-30 19:25:17+01:00 actual =2005-09-30 19:25:17+01:00 expected=2005-09-30 19:25:17-08:00 actual =2005-09-30 19:25:17-08:00 testing testOutputIsoWide OK The biggest problem still is that the library produces an output that it can not read back. Both input Lothar -- Lothar Werzinger Dipl.-Ing. Univ. framework & platform architect Tradescape Inc. - Enabling Efficient Digital Marketplaces 1754 Technology Drive, Suite 128 San Jose, CA 95110 web: http://www.tradescape.biz
On Thursday 31 July 2008, Lothar Werzinger wrote:
On Thursday 31 July 2008, Steven Watanabe wrote:
For wchar_t it might help to use wlocal_time_facet, e.g.
In Christ, Steven Watanabe
I changed the code in the wide functions to use the wlocal_time_facet (see attached sample) and now both non wide and wide behave the same. Thanks for the hint! I still wonder why I can apply a local_time_facet. Intuition tells me it should either work or not compile. I never thought the facet could be wrong, as it compiled. Thanks again for pointing that out!
Oh and how can I pick the "right" facet in a template function like: /// extraction operator to get a ISO formatted string from a DateTime. template < class charT, class traits > void operator >>= ( boost::local_time::local_date_time const & rc_value, std::basic_string < charT, traits > & r_result ) { std::basic_stringstream < charT, traits > os; // switch locale to ISO format boost::local_time::local_time_facet* output_facet = new boost::local_time::local_time_facet(); output_facet->format( boost::local_time::local_time_facet::iso_time_format_extended_specifier ); os.imbue(std::locale(std::locale("C"), output_facet)); os << rc_value; r_result = os.str(); } Lothar -- Lothar Werzinger Dipl.-Ing. Univ. framework & platform architect Tradescape Inc. - Enabling Efficient Digital Marketplaces 1754 Technology Drive, Suite 128 San Jose, CA 95110 web: http://www.tradescape.biz
participants (1)
-
Lothar Werzinger